Пример #1
0
 def format(str):
     parts = str.split('=')
     if len(parts) != 2:
         raise argparse.ArgumentError('--format', 'Expected --format LANG=FILENAME')
     lang, filename = parts
     try:
         cfg = Config.load(filename)
     except (IOError, ValueError):
         raise argparse.ArgumentError('--format', 'Failed to load format file {}'.format(parts[1]))
     return lang, cfg
Пример #2
0
 def format(str):
     parts = str.split('=')
     if len(parts) != 2:
         raise argparse.ArgumentError('--format',
                                      'Expected --format LANG=FILENAME')
     lang, filename = parts
     try:
         cfg = Config.load(filename)
     except (IOError, ValueError):
         raise argparse.ArgumentError(
             '--format', 'Failed to load format file {}'.format(parts[1]))
     return lang, cfg
Пример #3
0
 def config(str):
     return Config.load(str)
Пример #4
0
 def config(str):
     return Config.load(str)