degal/main.py
changeset 87 a7a18893730d
parent 76 e22d9f699081
child 89 4b254a90d6d0
child 92 eb50b4f7812d
equal deleted inserted replaced
86:d9a981cc0806 87:a7a18893730d
    13     
    13     
    14     # create parser using the given command
    14     # create parser using the given command
    15     parser = OptionParser(prog=command_name)
    15     parser = OptionParser(prog=command_name)
    16     
    16     
    17     # define options
    17     # define options
    18     parser.add_option('-G', "--gallery-path", dest='gallery_path', help="Use DIR as the Gallery path [default: CWD]", metavar='DIR', default=None)
    18     parser.add_option('-G', "--gallery-path",   metavar='DIR',  dest='gallery_path',    default=None,
    19     parser.add_option('-R', "--read-only", dest='read_only', help="Do not attempt to modify the gallery", action="store_true", default=False)
    19             help="Use DIR as the Gallery path [default: CWD]")
       
    20 
       
    21     parser.add_option('-R', "--read-only",      dest='read_only',  action="store_true", default=False,
       
    22             help="Do not attempt to modify the gallery")
       
    23 
       
    24     parser.add_option('-F', "--force-update",   dest='force_update', action="store_true", default=False,
       
    25             help="Force updates, even for fresh items")
    20     
    26     
    21     return parser
    27     return parser
    22 
    28 
    23 def build_config (options) :
    29 def build_config (options) :
    24     """
    30     """
    32     if options.gallery_path :
    38     if options.gallery_path :
    33         config.gallery_path = options.gallery_path
    39         config.gallery_path = options.gallery_path
    34     
    40     
    35     if options.read_only :
    41     if options.read_only :
    36         config.read_only = True
    42         config.read_only = True
       
    43 
       
    44     if options.force_update :
       
    45         config.force_update = True
    37 
    46 
    38     # XXX: load config file(s)
    47     # XXX: load config file(s)
    39 
    48 
    40     return config
    49     return config
    41 
    50