comparison sat_frontends/jp/base.py @ 3555:53fec6309fa3

cli: update constants to use new name
author Goffi <goffi@goffi.org>
date Wed, 09 Jun 2021 17:29:29 +0200
parents 1ac5570fa998
children 04283582966f
comparison
equal deleted inserted replaced
3554:184c66256bbc 3555:53fec6309fa3
66 'Progress bar deactivated\n--\n')) 66 'Progress bar deactivated\n--\n'))
67 print(msg, file=sys.stderr) 67 print(msg, file=sys.stderr)
68 progressbar=None 68 progressbar=None
69 69
70 #consts 70 #consts
71 PROG_NAME = "jp"
72 DESCRIPTION = """This software is a command line tool for XMPP. 71 DESCRIPTION = """This software is a command line tool for XMPP.
73 Get the latest version at """ + C.APP_URL 72 Get the latest version at """ + C.APP_URL
74 73
75 COPYLEFT = """Copyright (C) 2009-2021 Jérôme Poisson, Adrien Cossa 74 COPYLEFT = """Copyright (C) 2009-2021 Jérôme Poisson, Adrien Cossa
76 This program comes with ABSOLUTELY NO WARRANTY; 75 This program comes with ABSOLUTELY NO WARRANTY;
113 sys.exit(1) 112 sys.exit(1)
114 113
115 self.bridge = bridge_module.AIOBridge() 114 self.bridge = bridge_module.AIOBridge()
116 self._onQuitCallbacks = [] 115 self._onQuitCallbacks = []
117 116
118 def get_config(self, name, section='cli', default=None): 117 def get_config(self, name, section=C.CONFIG_SECTION, default=None):
119 """Retrieve a setting value from sat.conf""" 118 """Retrieve a setting value from sat.conf"""
120 return config.getConfig(self.sat_conf, section, name, default=default) 119 return config.getConfig(self.sat_conf, section, name, default=default)
121 120
122 def guess_background(self): 121 def guess_background(self):
123 if not sys.stdin.isatty() or not sys.stdout.isatty(): 122 if not sys.stdin.isatty() or not sys.stdout.isatty():
433 def add_parser_options(self): 432 def add_parser_options(self):
434 self.parser.add_argument( 433 self.parser.add_argument(
435 '--version', 434 '--version',
436 action='version', 435 action='version',
437 version=("{name} {version} {copyleft}".format( 436 version=("{name} {version} {copyleft}".format(
438 name = PROG_NAME, 437 name = C.APP_NAME,
439 version = self.version, 438 version = self.version,
440 copyleft = COPYLEFT)) 439 copyleft = COPYLEFT))
441 ) 440 )
442 441
443 def register_output(self, type_, name, callback, description="", default=False): 442 def register_output(self, type_, name, callback, description="", default=False):