[IMP] cli first command testjs
bzr revid: al@openerp.com-20121209024618-cae0ux1vmo38ccwr
This commit is contained in:
parent
fb0ded57ff
commit
f224ce1d8b
|
@ -23,6 +23,7 @@ Depends:
|
||||||
python-libxslt1,
|
python-libxslt1,
|
||||||
python-lxml,
|
python-lxml,
|
||||||
python-mako,
|
python-mako,
|
||||||
|
python-mock,
|
||||||
python-openid,
|
python-openid,
|
||||||
python-psutil,
|
python-psutil,
|
||||||
python-psycopg2,
|
python-psycopg2,
|
||||||
|
|
|
@ -2,6 +2,8 @@ import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import openerp
|
import openerp
|
||||||
|
from openerp import tools
|
||||||
|
from openerp.modules import module
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -32,8 +34,25 @@ import server
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
args = sys.argv[1:]
|
args = sys.argv[1:]
|
||||||
|
|
||||||
|
# The only shared option is '--addons-path=' needed to discover additional
|
||||||
|
# commands from modules
|
||||||
|
if len(args) > 1 and args[0].startswith('--addons-path=') and not args[1].startswith("-"):
|
||||||
|
tools.config.parse_config([args[0]])
|
||||||
|
args = args[1:]
|
||||||
|
|
||||||
|
# Default legacy command
|
||||||
command = "server"
|
command = "server"
|
||||||
|
|
||||||
|
# Subcommand discovery
|
||||||
if len(args) and not args[0].startswith("-"):
|
if len(args) and not args[0].startswith("-"):
|
||||||
|
for m in module.get_modules():
|
||||||
|
m = 'openerp.addons.' + m
|
||||||
|
__import__(m)
|
||||||
|
#try:
|
||||||
|
#except Exception, e:
|
||||||
|
# raise
|
||||||
|
# print e
|
||||||
command = args[0]
|
command = args[0]
|
||||||
args = args[1:]
|
args = args[1:]
|
||||||
|
|
||||||
|
|
|
@ -433,8 +433,9 @@ def get_modules():
|
||||||
return name
|
return name
|
||||||
|
|
||||||
def is_really_module(name):
|
def is_really_module(name):
|
||||||
name = opj(dir, name)
|
manifest_name = opj(dir, name, '__openerp__.py')
|
||||||
return os.path.isdir(name) or zipfile.is_zipfile(name)
|
zipfile_name = opj(dir, name)
|
||||||
|
return os.path.isfile(manifest_name) or zipfile.is_zipfile(zipfile_name)
|
||||||
return map(clean, filter(is_really_module, os.listdir(dir)))
|
return map(clean, filter(is_really_module, os.listdir(dir)))
|
||||||
|
|
||||||
plist = []
|
plist = []
|
||||||
|
|
1
setup.py
1
setup.py
|
@ -108,6 +108,7 @@ setuptools.setup(
|
||||||
'gdata',
|
'gdata',
|
||||||
'lxml < 3', # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
|
'lxml < 3', # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
|
||||||
'mako',
|
'mako',
|
||||||
|
'mock',
|
||||||
'PIL', # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
|
'PIL', # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
|
||||||
'psutil', # windows binary code.google.com/p/psutil/downloads/list
|
'psutil', # windows binary code.google.com/p/psutil/downloads/list
|
||||||
'psycopg2',
|
'psycopg2',
|
||||||
|
|
Loading…
Reference in New Issue