Commit 7c4a6e7d authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

merge stable, fixing dependencies generation on c-c newcube on the way

......@@ -108,11 +108,50 @@ def repo_connect(repo, login, **kwargs):
def connect(database=None, login=None, host=None, group=None,
cnxprops=None, setvreg=True, mulcnx=True, initlog=True, **kwargs):
"""Constructor for creating a connection to the CubicWeb repository.
Returns a Connection object.
Returns a :class:`Connection` object.
When method is 'pyro', setvreg is True, try to deal with connections to
differents instances in the same process unless specified otherwise by
setting the mulcnx to False.
Typical usage::
cnx = connect('myinstance', login='me', password='toto')
Arguments:
:database:
the instance's pyro identifier.
:login:
the user login to use to authenticate.
:host:
the pyro nameserver host. Will be detected using broadcast query if
unspecified.
:group:
the instance's pyro nameserver group. You don't have to specify it unless
tweaked in instance's configuration.
:cnxprops:
an optional :class:`ConnectionProperties` instance, allowing to specify
the connection method (eg in memory or pyro). A Pyro connection will be
established if you don't specify that argument.
:setvreg:
flag telling if a registry should be initialized for the connection.
Don't change this unless you know what you're doing.
:mulcnx:
Will disappear at some point. Try to deal with connections to differents
instances in the same process unless specified otherwise by setting this
flag to False. Don't change this unless you know what you're doing.
:initlog:
flag telling if logging should be initialized. You usually don't want
logging initialization when establishing the connection from a process
where it's already initialized.
:kwargs:
there goes authentication tokens. You usually have to specify for
instance a password for the given user, using a named 'password' argument.
"""
config = cwconfig.CubicWebNoAppConfiguration()
if host:
......
......@@ -50,7 +50,7 @@ Depends: python-psycopg2, postgresql-client
Description: postgres support for the CubicWeb framework
CubicWeb is a semantic web application framework.
.
This virtual package provides dependancies to use postgres for the
This virtual package provides dependencies to use postgres for the
cubicweb repository.
Package: cubicweb-mysql-support
......@@ -60,7 +60,7 @@ Depends: python-mysqldb, mysql-client
Description: mysql support for the CubicWeb framework
CubicWeb is a semantic web application framework.
.
This virtual package provides dependancies to use mysql for the
This virtual package provides dependencies to use mysql for the
cubicweb repository.
......
......@@ -538,19 +538,14 @@ layout, and a full featured cube with "full" layout.',
longdesc = shortdesc = raw_input('Enter a short description for your cube: ')
if verbose:
longdesc = raw_input('Enter a long description (leave empty to reuse the short one): ')
dependencies = {'cubicweb': '>= %s' % cubicwebversion}
if verbose:
includes = self._ask_for_dependancies()
if len(includes) == 1:
dependancies = '%r,' % includes[0]
else:
dependancies = ', '.join(repr(cube) for cube in includes)
else:
dependancies = ''
dependencies.update(self._ask_for_dependencies())
context = {'cubename' : cubename,
'distname' : distname,
'shortdesc' : shortdesc,
'longdesc' : longdesc or shortdesc,
'dependancies' : dependancies,
'dependencies' : dependencies,
'version' : cubicwebversion,
'year' : str(datetime.now().year),
'author': self['author'],
......@@ -565,21 +560,22 @@ layout, and a full featured cube with "full" layout.',
'cubes.*', 'external_resources*')
copy_skeleton(skeldir, cubedir, context, exclude=exclude)
def _ask_for_dependancies(self):
def _ask_for_dependencies(self):
from logilab.common.shellutils import ASK
from logilab.common.textutils import splitstrip
includes = []
for stdtype in ServerConfiguration.available_cubes():
answer = ASK.ask("Depends on cube %s? " % stdtype,
depcubes = []
for cube in ServerConfiguration.available_cubes():
answer = ASK.ask("Depends on cube %s? " % cube,
('N','y','skip','type'), 'N')
if answer == 'y':
includes.append(stdtype)
depcubes.append(cube)
if answer == 'type':
includes = splitstrip(raw_input('type dependancies: '))
depcubes = splitstrip(raw_input('type dependencies: '))
break
elif answer == 'skip':
break
return includes
return dict(('cubicweb-' + cube, ServerConfiguration.cube_version(cube))
for cube in depcubes)
class ExamineLogCommand(Command):
......
......@@ -195,7 +195,7 @@ class NewGoogleAppCommand(Command):
# goa instance'skeleton
copy_skeleton(join(CW_SOFTWARE_ROOT, 'goa', 'skel'),
appldir, context, askconfirm=True)
# cubicweb core dependancies
# cubicweb core dependencies
for directory, subdirectory in slink_directories():
subdirectory = join(appldir, subdirectory)
if not exists(split(subdirectory)[0]):
......
......@@ -40,6 +40,6 @@ for dname in ('entities', 'views', 'sobjects', 'hooks', 'schema', 'data', 'i18n'
# Note: here, you'll need to add subdirectories if you want
# them to be included in the debian package
__depends__ = {'cubicweb': '>= %(version)s'}
__depends__ = %(dependencies)s
__recommends__ = {}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment