예제 #1
0
파일: cmdline.py 프로젝트: wari/phil
def next6_cmd(parsed):
    conffile = os.path.abspath(parsed.runconffile)
    if not os.path.exists(conffile):
        phil.err('{0} does not exist.'.format(conffile))
        return 1

    p = phil.Phil(parsed.quiet, parsed.debug)
    return p.next6(conffile)
예제 #2
0
파일: cmdline.py 프로젝트: B-Rich/phil
def next6_cmd(parsed):
    conffile = os.path.abspath(parsed.runconffile)
    if not os.path.exists(conffile):
        phil.err("{0} does not exist.".format(conffile))
        return 1

    p = phil.Phil(parsed.quiet, parsed.debug)
    return p.next6(conffile)
예제 #3
0
파일: cmdline.py 프로젝트: B-Rich/phil
def createfile_cmd(parsed):
    outfile = parsed.conffile
    path = os.path.abspath(outfile)
    conffile = phil.get_template()
    if os.path.exists(path):
        phil.err("{0} exists.  Remove it and try again or try again with " "a different filename.".format(outfile))
        return 1

    f = open(path, "w")
    f.write(conffile)
    f.close()

    phil.out("{0} written.  Open it in your favorite editor and read it.".format(outfile))
    return 0
예제 #4
0
파일: cmdline.py 프로젝트: wari/phil
def createfile_cmd(parsed):
    outfile = parsed.conffile
    path = os.path.abspath(outfile)
    conffile = phil.get_template()
    if os.path.exists(path):
        phil.err('{0} exists.  Remove it and try again or try again with '
                 'a different filename.'.format(outfile))
        return 1

    f = open(path, 'w')
    f.write(conffile)
    f.close()

    phil.out('{0} written.  Open it in your favorite editor and read it.'
        .format(outfile))
    return 0