View Single Post
Old 10-30-2020, 11:34 AM   #368
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,207
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Also if someone can explain what the code below is trying to do — especially the part highlighted in red — I would appreciate it.

Code:
                if external_app_path.lower().endswith('calibredb.exe'):
                    print('running a calibredb command.')
                    startupinfo = subprocess.STARTUPINFO()
                    startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
                    fred = 'calibredb add --library-path="C:/Users/Declan/Documents/Calibre Library" -d "D:/Downloads/Merlin-Thered Been A Time - A_Fallen_Sister.epub"'
                    p = subprocess.Popen(fred, shell=True, startupinfo=startupinfo)
                    rc = p.wait()
                    if rc != 0:
                        if DEBUG: print("FAILURE for: ", fred)
                    else:
                        if DEBUG: print("...success for...", fred)
capink is offline   Reply With Quote