move oxjs into extra module

This commit is contained in:
j 2015-03-08 00:28:24 +05:30
parent 2da0bed0ee
commit 4d4bd252fe
2 changed files with 11 additions and 3 deletions

View file

@ -6,6 +6,7 @@ import subprocess
from os.path import join, exists, dirname from os.path import join, exists, dirname
import os import os
import sys import sys
import shutil
import settings import settings
@ -33,7 +34,10 @@ def version(module):
version += '-' + get('git', 'describe', '--always').strip() version += '-' + get('git', 'describe', '--always').strip()
os.chdir(root_dir) os.chdir(root_dir)
else: else:
version = settings.release['modules'][module]['version'] if module in settings.release['modules']:
version = settings.release['modules'][module]['version']
else:
version = -1
return version return version
def command_version(*args): def command_version(*args):
@ -104,7 +108,10 @@ def command_update_static(*args):
""" """
import setup import setup
setup.create_db() setup.create_db()
oxjs = os.path.join(settings.static_path, 'oxjs') old_oxjs = os.path.join(settings.static_path, 'oxjs')
oxjs = os.path.join(settings.base_dir, '..', 'oxjs')
if os.path.exists(old_oxjs) and not os.path.exists(oxjs):
shutil.move(old_oxjs, oxjs)
if not os.path.exists(oxjs): if not os.path.exists(oxjs):
r('git', 'clone', 'https://git.0x2620.org/oxjs.git', oxjs) r('git', 'clone', 'https://git.0x2620.org/oxjs.git', oxjs)
elif os.path.exists(os.path.join(oxjs, '.git')): elif os.path.exists(os.path.join(oxjs, '.git')):
@ -142,7 +149,7 @@ def command_release(*args):
h.update(chunk) h.update(chunk)
return h.hexdigest() return h.hexdigest()
MODULES = ['platform', 'openmedialibrary'] MODULES = ['platform', 'openmedialibrary', 'oxjs']
VERSIONS = {module:version(module) for module in MODULES} VERSIONS = {module:version(module) for module in MODULES}
EXCLUDE=[ EXCLUDE=[

View file

@ -57,6 +57,7 @@ def run():
handlers = [ handlers = [
(r'/(favicon.ico)', StaticFileHandler, {'path': settings.static_path}), (r'/(favicon.ico)', StaticFileHandler, {'path': settings.static_path}),
(r'/static/oxjs/(.*)', StaticFileHandler, {'path': os.path.join(settings.base_dir, '..', 'oxjs')}),
(r'/static/(.*)', StaticFileHandler, {'path': settings.static_path}), (r'/static/(.*)', StaticFileHandler, {'path': settings.static_path}),
(r'/(.*)/epub/(.*)', EpubHandler), (r'/(.*)/epub/(.*)', EpubHandler),
(r'/(.*?)/reader/', ReaderHandler), (r'/(.*?)/reader/', ReaderHandler),