Esempio n. 1
0
# 8) 增加一个 loggerNN, NN 自动计算
#    $ galaxy_loggers.py --add-logger
#
# 9) 删除最后增加的 loggerNN
#    $ galaxy_loggers.py --remove-logger
#
# 10) 显示帮助
#    $ galaxy_loggers.py --help
#
# 注意:
#   如果不是以 root 用户启动程序, 则应用程序本身的日志 (applog) 不会创建.
#
########################################################################
if __name__ == "__main__":

    parser, group, optparse = util.use_parser_group(APPNAME, APPVER, APPHELP,
        '%prog WORKERs [Options] ...\n  WORKERs   names for logger workers. (for instance: "weblogger,webloger2")')

    group.add_option("--log-path",
        action="store", dest="log_path", type="string", default=os.path.join(APPHOME, "applog"),
        help="specify path to store application log (NOT logger data files)",
        metavar="LOGPATH")

    group.add_option("--log-level",
        action="store", dest="log_level", type="string", default="DEBUG",
        help="specify log level for logger: DEBUG, WARN, INFO, ERROR. default: DEBUG",
        metavar="LOGLEVEL")

    # you may change below for override default setting:
    stash_dir = os.path.join(APPHOME, "tmp/stash")

    group.add_option("--stash",
Esempio n. 2
0
    pass


########################################################################
# Usage:
#
#   $ ./repl.py -P './' -S "__cleanup" -D "___cleanup"
#
# 替换文件的创建时间
#   $ ./scripts/repl.py -S "@create:" -D "@create: $(ctime)" -L -R
#
# 替换文件的修改时间
#   $ ./scripts/repl.py -S "@modify:" -D "@modify: $(mtime)" -L -R
#
if __name__ == "__main__":
    parser, group, optparse = util.use_parser_group(APPNAME, APPVER, APPHELP,
                                                    '%prog [Options]')

    group.add_option("-P",
                     "--path",
                     action="store",
                     dest="path",
                     type="string",
                     default=None,
                     help="Specifies root path to replace",
                     metavar="PATH")

    group.add_option("-S",
                     "--srcs",
                     action="store",
                     dest="srcs",
                     type="string",
Esempio n. 3
0
    sweep_path(root_path, file_exts, options.recursive, options.author,
               curtime)

    pass


#######################################################################
# Usage:
#
#   $ ./updt.py -P /path/to/file -R
#   $ ./updt.py -P /path/to/file -F "java"
#
if __name__ == "__main__":
    parser, group, optparse = util.use_parser_group(appname=APPNAME,
                                                    appver=APPVER,
                                                    apphelp=APPHELP,
                                                    usage='%prog [Options]')

    group.add_option("-P",
                     "--path",
                     action="store",
                     dest="path",
                     type="string",
                     default=None,
                     help="specify path to update.",
                     metavar="PATH")

    group.add_option("-F",
                     "--filter",
                     action="store",
                     dest="filter",