NAME = 'CEdit' __version__ = '3.1.2' VERSIONSTR = '{} v. {}'.format(NAME, __version__) SCRIPT = os.path.split(os.path.abspath(sys.argv[0]))[1] SCRIPTDIR = os.path.abspath(sys.path[0]) OPTIONS = { 'editor': 'editor to open files.', 'elevcmd': 'elevation command for when root is needed.', 'rooteditor': 'editor to use when elevation command is used.', } CONFIGFILE = os.path.join(SCRIPTDIR, 'cedit.conf') settings = EasySettings(CONFIGFILE) settings.name = NAME settings.version = __version__ USAGESTR = """{ver} Opens files with your favorite editor, and uses an elevation command automatically when needed for write access. Usage: {script} -h | -l | -v {script} -s option... {script} PATH... [-- EDITOR_ARGS...] Options: EDITOR_ARGS : Extra arguments to pass on to the editor. The -- separator must be used.
from twisted.words.protocols import irc # Local stuff (Command Handler) from pyval_commands import AdminHandler, CommandHandler from pyval_util import NAME, VERSION, VERSIONSTR SCRIPT = os.path.split(sys.argv[0])[1] BANFILE = '{}_banned.lst'.format(NAME.lower().replace(' ', '-')) DEFAULT_CONFIGFILE = '{}.conf'.format(NAME.lower().replace(' ', '_')) DEFAULT_CONFIGFILE = os.path.join(sys.path[0], DEFAULT_CONFIGFILE) # Config file is loaded after checking args in main(). # Alternate config may be used... CONFIG = EasySettings() CONFIG.name = NAME CONFIG.version = VERSION USAGESTR = """{versionstr} Usage: {script} -h | -v {script} [options] Options: -a,--autosave : Automatically save new command-line options to config file. (passwords are stored in plain text!) -b,--noheartbeat : Don't log the heartbeat pongs. -c chans,--channels chans : Comma-separated list of channels to join. -C chr,--commandchar chr : Character that marks a msg as a command. Messages that start with this character are considered commands by {name}.
sys.exit(1) NAME = 'CEdit' __version__ = '3.1.2' VERSIONSTR = '{} v. {}'.format(NAME, __version__) SCRIPT = os.path.split(os.path.abspath(sys.argv[0]))[1] SCRIPTDIR = os.path.abspath(sys.path[0]) OPTIONS = { 'editor': 'editor to open files.', 'elevcmd': 'elevation command for when root is needed.', 'rooteditor': 'editor to use when elevation command is used.', } CONFIGFILE = os.path.join(SCRIPTDIR, 'cedit.conf') settings = EasySettings(CONFIGFILE) settings.name = NAME settings.version = __version__ USAGESTR = """{ver} Opens files with your favorite editor, and uses an elevation command automatically when needed for write access. Usage: {script} -h | -l | -v {script} -s option... {script} PATH... [-- EDITOR_ARGS...] Options: EDITOR_ARGS : Extra arguments to pass on to the editor. The -- separator must be used.
# Local stuff (Command Handler) from pyval_commands import AdminHandler, CommandHandler from pyval_util import NAME, VERSION, VERSIONSTR SCRIPT = os.path.split(sys.argv[0])[1] BANFILE = '{}_banned.lst'.format(NAME.lower().replace(' ', '-')) DEFAULT_CONFIGFILE = '{}.conf'.format(NAME.lower().replace(' ', '_')) DEFAULT_CONFIGFILE = os.path.join(sys.path[0], DEFAULT_CONFIGFILE) # Config file is loaded after checking args in main(). # Alternate config may be used... CONFIG = EasySettings() CONFIG.name = NAME CONFIG.version = VERSION USAGESTR = """{versionstr} Usage: {script} -h | -v {script} [options] Options: -a,--autosave : Automatically save new command-line options to config file. (passwords are stored in plain text!) -b,--noheartbeat : Don't log the heartbeat pongs. -c chans,--channels chans : Comma-separated list of channels to join. -C chr,--commandchar chr : Character that marks a msg as a command. Messages that start with this character are considered commands by {name}.