Exemplo n.º 1
0
 def __init__(self):
     from cli_options_parser import parser
     
     Options.__init__(self)
     opts, args = parser.parse_args()
     self.options = opts.__dict__
     self.options['path'] = [os.path.normpath(path) for path in args]
Exemplo n.º 2
0
 def __init__(self, profile='default'):
     Options.__init__(self)
     
     if _PROFILES is not None:
         try:
             opts, args = parser.parse_args(shlex.split(_PROFILES[profile]))
             self.options = opts.__dict__
             self.options['path'] = args
         except KeyError:
             if profile != 'default':
                 sys.stderr.write("Error: there is no profile with name '%s'\n" % profile)
                 sys.exit()