File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+ import importlib
3+ import os
4+ import sys
5+
6+
7+ sys .run_local = os .path .abspath (__file__ )
8+ base = os .path .dirname (sys .run_local )
9+ src = os .path .join (base , 'src' )
10+ if src not in sys .path :
11+ sys .path .insert (0 , src )
12+ sys .resources_location = os .path .join (base , 'resources' )
13+ sys .extensions_location = os .path .join (src , 'calibre' , 'plugins' )
14+ entry_point = sys .argv [1 ]
15+ del sys .argv [1 ]
16+ del src
17+ del base
18+
19+ for ep in importlib .import_module ('calibre.linux' ).entry_points .values ():
20+ for line in ep :
21+ q , spec = (x .strip () for x in line .split ('=' ))
22+ if q == entry_point :
23+ mod , func = spec .split (':' )
24+ m = importlib .import_module (mod )
25+ sys .exit (getattr (m , func )())
26+ raise SystemExit ('No entry point named: {}' .format (entry_point ))
Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ def osx_contents_dir(self):
6262 def executable (self ):
6363 if hasattr (sys , 'running_from_setup' ):
6464 return [sys .executable , os .path .join (sys .setup_dir , 'run-calibre-worker.py' )]
65+ if getattr (sys , 'run_local' , False ):
66+ return [sys .executable , sys .run_local , self .exe_name ]
6567 e = self .exe_name
6668 if iswindows :
6769 return os .path .join (os .path .dirname (sys .executable ),
You can’t perform that action at this time.
0 commit comments