mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
calibre-debug: support execution of a directory containing a __main__.py file
This commit is contained in:
parent
bf5c3f9be1
commit
048c26fdce
@ -278,6 +278,9 @@ def main(args=sys.argv):
|
|||||||
inspect_mobi(path)
|
inspect_mobi(path)
|
||||||
else:
|
else:
|
||||||
print ('Cannot dump unknown filetype: %s' % path)
|
print ('Cannot dump unknown filetype: %s' % path)
|
||||||
|
elif len(args) >= 2 and os.path.exists(os.path.join(args[1], '__main__.py')):
|
||||||
|
sys.path.insert(0, args[1])
|
||||||
|
run_script(os.path.join(args[1], '__main__.py'), args[2:])
|
||||||
else:
|
else:
|
||||||
from calibre import ipython
|
from calibre import ipython
|
||||||
ipython()
|
ipython()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user