Beispiel #1
0
 def my_init(self):
     comm.print_ok("Starting wiki monitor daemon...")
     FORMAT = ("%(asctime)s %(levelname)8s "
               "%(funcName)s(%(filename)s:%(lineno)s) : %(message)s")
     logging.basicConfig(level=logging.INFO,
                         filename=LOG_FILE,
                         format=FORMAT)
     logging.info("Starting wiki monitor...")
Beispiel #2
0
 def my_init(self):
     comm.print_ok("Starting wiki monitor daemon...")
     FORMAT = ("%(asctime)s %(levelname)8s "
     "%(funcName)s(%(filename)s:%(lineno)s) : %(message)s")
     logging.basicConfig(
             level=logging.INFO, 
             filename=LOG_FILE, 
             format=FORMAT)
     logging.info("Starting wiki monitor...")
Beispiel #3
0
def generator(md_file, debug_mode=False):
    if not _check_path_exists(md_file):
        _, md_name = _get_dir_and_md_name(md_file)
        sys.exit(comm.color_error("[%s] file does not exists" % md_name))
    _check_suffix(md_file)

    dir_name, md_name = _get_dir_and_md_name(md_file)
    title = _get_title(md_file)
    html = _md2html(md_file, title)

    if debug_mode:
        print(html)
    else:
        _update_wiki_page(dir_name, md_name, html)
        _update_dir_page(dir_name, md_name, title)
        comm.print_ok("[%s]" % md_name, " updated ok.")