mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Allow setup to be run from outside the tree
This commit is contained in:
parent
227cc4b103
commit
4e0d95818c
@ -46,13 +46,13 @@ def require_clean_git():
|
|||||||
def initialize_constants():
|
def initialize_constants():
|
||||||
global __version__, __appname__, modules, functions, basenames, scripts
|
global __version__, __appname__, modules, functions, basenames, scripts
|
||||||
|
|
||||||
src = open('src/calibre/constants.py', 'rb').read()
|
src = open(os.path.join(SRC, 'calibre/constants.py'), 'rb').read()
|
||||||
nv = re.search(r'numeric_version\s+=\s+\((\d+), (\d+), (\d+)\)', src)
|
nv = re.search(r'numeric_version\s+=\s+\((\d+), (\d+), (\d+)\)', src)
|
||||||
__version__ = '%s.%s.%s'%(nv.group(1), nv.group(2), nv.group(3))
|
__version__ = '%s.%s.%s'%(nv.group(1), nv.group(2), nv.group(3))
|
||||||
__appname__ = re.search(r'__appname__\s+=\s+(u{0,1})[\'"]([^\'"]+)[\'"]',
|
__appname__ = re.search(r'__appname__\s+=\s+(u{0,1})[\'"]([^\'"]+)[\'"]',
|
||||||
src).group(2)
|
src).group(2)
|
||||||
epsrc = re.compile(r'entry_points = (\{.*?\})', re.DOTALL).\
|
epsrc = re.compile(r'entry_points = (\{.*?\})', re.DOTALL).\
|
||||||
search(open('src/calibre/linux.py', 'rb').read()).group(1)
|
search(open(os.path.join(SRC, 'calibre/linux.py'), 'rb').read()).group(1)
|
||||||
entry_points = eval(epsrc, {'__appname__': __appname__})
|
entry_points = eval(epsrc, {'__appname__': __appname__})
|
||||||
|
|
||||||
def e2b(ep):
|
def e2b(ep):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user