cwconfig.py
branchstable
changeset 4936 a4b772a0d801
parent 4889 b3e2de8f53cd
child 4938 b1a4fe480de5
equal deleted inserted replaced
4935:f710770e6e90 4936:a4b772a0d801
   113     except IndexError:
   113     except IndexError:
   114         raise ConfigurationError('no such config %r (check it exists with "cubicweb-ctl list")' % name)
   114         raise ConfigurationError('no such config %r (check it exists with "cubicweb-ctl list")' % name)
   115 
   115 
   116 def possible_configurations(directory):
   116 def possible_configurations(directory):
   117     """return a list of installed configurations in a directory
   117     """return a list of installed configurations in a directory
   118     according to *-ctl files
   118     according to \*-ctl files
   119     """
   119     """
   120     return [name for name in ('repository', 'twisted', 'all-in-one')
   120     return [name for name in ('repository', 'twisted', 'all-in-one')
   121             if exists(join(directory, '%s.conf' % name))]
   121             if exists(join(directory, '%s.conf' % name))]
   122 
   122 
   123 def guess_configuration(directory):
   123 def guess_configuration(directory):
   916 
   916 
   917     def available_languages(self, *args):
   917     def available_languages(self, *args):
   918         """return available translation for an instance, by looking for
   918         """return available translation for an instance, by looking for
   919         compiled catalog
   919         compiled catalog
   920 
   920 
   921         take *args to be usable as a vocabulary method
   921         take \*args to be usable as a vocabulary method
   922         """
   922         """
   923         from glob import glob
   923         from glob import glob
   924         yield 'en' # ensure 'en' is yielded even if no .mo found
   924         yield 'en' # ensure 'en' is yielded even if no .mo found
   925         for path in glob(join(self.apphome, 'i18n',
   925         for path in glob(join(self.apphome, 'i18n',
   926                               '*', 'LC_MESSAGES')):
   926                               '*', 'LC_MESSAGES')):