Beispiel #1
0
    return logging.getLogger(__name__)

# entry point
if __name__ == "__main__":
    args = input_arguments()
    logger = log_configuration(args.verbose)

    if args.alternate_prefix:
        prefix = args.alternate_prefix
        dir_prefix = os.path.expanduser(prefix)
    else:
        dir_prefix = DEFAULT_PREFIX
    if args.alternate_config_file:
        conf = args.alternate_config_file
        config_file = process_path(conf)
    else:
        config_file = os.path.join(dir_prefix, DEFAULT_CONFIG_FILENAME)

    root = tk.Tk()
    ac = AppConfig(config_file)
    # set bookmarks and log filename in this order:
    #   use command line alternate path
    #   use path from config file
    #   use default path
    ac.read_conf()

    if args.alternate_bookmark_file != None:
        bookmarks = args.alternate_bookmark_file
        ac.config['bookmark_filename'] = process_path(bookmarks)
    elif ac.config["bookmark_filename"] == None:
Beispiel #2
0
def test_process_path_2():
    path="~/test/p"
    processed_path= process_path(path)
    assert(("home" in processed_path) ==True)
Beispiel #3
0
def test_process_path_1():
    path= "/tmp/p"
    assert(path == process_path(path))
Beispiel #4
0
                            datefmt="%m/%d/%Y %I:%M:%S %p %Z")

    return logging.getLogger(__name__)

# entry point
if __name__ == "__main__":

    args = input_arguments()
    logger = log_configuration(args.verbose)

    if args.alternate_prefix:
        dir_prefix = os.path.expanduser(args.alternate_prefix)
    else:
        dir_prefix = os.path.expanduser(DEFAULT_PREFIX)
    if args.alternate_config_file:
        config_file = process_path(args.alternate_config_file)
    else:
        config_file = os.path.join(dir_prefix, DEFAULT_CONFIG_FILENAME)

    root = tk.Tk()
    ac = AppConfig(config_file)
    # set bookmarks and log filename in this order:
    #   use command line alternate path
    #   use path from config file
    #   use default path
    if args.alternate_bookmark_file:
        ac.config['bookmark_filename'] = process_path(args.alternate_bookmark_file)
    elif ac.config['bookmark_filename'] == 'noname':
        ac.config['bookmark_filename'] = os.path.join(dir_prefix, DEFAULT_BOOKMARK_FILENAME)
    #set activity log filename
    if args.alternate_log_file:
Beispiel #5
0
def test_process_path_2():
    path="~/test/p"
    processed_path= process_path(path)
    assert(("home" in processed_path) ==True)
Beispiel #6
0
def test_process_path_1():
    path= "/tmp/p"
    assert(path == process_path(path))