View Single Post
Old 10-30-2020, 09:34 PM   #372
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by capink View Post
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)
That is something I was experimenting with a long time ago. From memory, there was some claim posted about how calibredb.exe had to be run and I was trying work out if they were correct. At around the same time, I was also trying to work out if Sigil needed to still be handled separately. The highlighted line was just me hardcoding something so that I knew exactly what the results should be. And didn't clobber the real library.

You can safely remove it.
davidfor is offline   Reply With Quote