mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-22 18:39:31 +01:00
parent
61f03ff0ed
commit
b882d1cc00
7
setup.py
7
setup.py
@ -48,7 +48,10 @@ if debug:
|
|||||||
if path:
|
if path:
|
||||||
os.chdir(path)
|
os.chdir(path)
|
||||||
|
|
||||||
|
if os.path.isdir('src'):
|
||||||
VERSION_FILE = os.path.join('src', 'version.py')
|
VERSION_FILE = os.path.join('src', 'version.py')
|
||||||
|
else:
|
||||||
|
VERSION_FILE = os.path.join('supybot', 'version.py')
|
||||||
version = None
|
version = None
|
||||||
try:
|
try:
|
||||||
if 'SOURCE_DATE_EPOCH' in os.environ:
|
if 'SOURCE_DATE_EPOCH' in os.environ:
|
||||||
@ -64,7 +67,7 @@ try:
|
|||||||
time.strptime(time.asctime(time.gmtime(date)))[:3])
|
time.strptime(time.asctime(time.gmtime(date)))[:3])
|
||||||
except:
|
except:
|
||||||
if os.path.isfile(VERSION_FILE):
|
if os.path.isfile(VERSION_FILE):
|
||||||
from src.version import version
|
from supybot.version import version
|
||||||
else:
|
else:
|
||||||
version = 'installed on ' + time.strftime("%Y-%m-%dT%H-%M-%S", time.gmtime())
|
version = 'installed on ' + time.strftime("%Y-%m-%dT%H-%M-%S", time.gmtime())
|
||||||
try:
|
try:
|
||||||
@ -72,7 +75,7 @@ try:
|
|||||||
except OSError: # Does not exist
|
except OSError: # Does not exist
|
||||||
pass
|
pass
|
||||||
if version:
|
if version:
|
||||||
fd = open(os.path.join('src', 'version.py'), 'a')
|
fd = open(VERSION_FILE, 'a')
|
||||||
fd.write("version = '%s'\n" % version)
|
fd.write("version = '%s'\n" % version)
|
||||||
fd.write('try: # For import from setup.py\n')
|
fd.write('try: # For import from setup.py\n')
|
||||||
fd.write(' import supybot.utils.python\n')
|
fd.write(' import supybot.utils.python\n')
|
||||||
|
Loading…
Reference in New Issue
Block a user