本文整理汇总了Python中cjh.cli.Cli.view_source方法的典型用法代码示例。如果您正苦于以下问题:Python Cli.view_source方法的具体用法?Python Cli.view_source怎么用?Python Cli.view_source使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cjh.cli.Cli
的用法示例。
在下文中一共展示了Cli.view_source方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from cjh.cli import Cli [as 别名]
# 或者: from cjh.cli.Cli import view_source [as 别名]
def main():
"""
Writes requested modifications to the 'config.json' file, and sends
some kind of feedback to stdout.
"""
if ARGS.s is not None:
CONFIG.write_to_config_file(shell=ARGS.s)
if ARGS.e is not None:
CONFIG.write_to_config_file(editor=ARGS.e)
if ARGS.t is not None:
CONFIG.write_to_config_file(terminal=ARGS.t)
if ARGS.l is not None:
CONFIG.write_to_config_file(language=ARGS.l)
# config_dict = {'shell':shell}
# with open(filename, 'w') as outfile: json.dump(
# config_dict, outfile, indent=2)
string = ''
if (ARGS.v >= 1 and ARGS.s is not None) or not (
ARGS.e or ARGS.s or ARGS.t or ARGS.l):
string += "\n shell: '{}'".format(shell)
if (ARGS.v >= 1 and ARGS.e is not None) or not (
ARGS.e or ARGS.s or ARGS.t or ARGS.l):
string += "\n editor: '{}'".format(editor)
if (ARGS.v >= 1 and ARGS.t is not None) or not (
ARGS.e or ARGS.s or ARGS.t or ARGS.l):
string += "\nterminal: '{}'".format(terminal)
if (ARGS.v >= 1 and ARGS.l is not None) or not (
ARGS.e or ARGS.s or ARGS.t or ARGS.l):
string += "\nlanguage: '{}'".format(language)
if len(string) > 0:
print(string + '\n') # pylint: disable=C0325
if (ARGS.v >= 2) or (
not (ARGS.e or ARGS.s or ARGS.t or ARGS.l) and ARGS.v >= 1):
Cli.view_source(FILENAME)
if ARGS.s or ARGS.e or ARGS.t or ARGS.l:
Cli.report_filesave(FILENAME)