def __init__(self, network): irclib.SimpleIRCClient.__init__(self) network_config = utils.get_config(network) self.log = log.get_logger(str(network)) self.version = version.version_string() self.source = None self.target = None self.addressed = False self.admins = CONFIG.get("admins", type="list") self.command_prefix = CONFIG.get("command_prefix") self.reconnect_delay = CONFIG.get("reconnect_delay", type="int") self.rejoin_delay = CONFIG.get("rejoin_delay", type="int") self.server = network_config.get("server") self.password = network_config.get("password", default=None) self.port = network_config.get("port", type="int", default=6667) self.ssl = network_config.get("ssl", type="bool", default=False) self.ipv6 = network_config.get("ipv6", type="bool", default=False) self.bind_to = network_config.get("bind_to", default=None) self.nick = network_config.get("nick") self.username = network_config.get("username", default=None) self.identify_password = network_config.get("identify_password", default=None) self.channels = network_config.get("channels", type="list") self.load_plugins() self.log.info("Connecting to %s:%d as %s" % (self.server, self.port, self.nick)) self.connect(self.server, self.port, self.nick, self.password, ssl=self.ssl, ipv6=self.ipv6, localaddress=self.bind_to, username=self.username)
def main(): """Main IRC loop.""" networks = CONFIG.get("networks", type="list") LOG.info("Starting %s" % version.version_string()) LOG.info("Connecting to IRC Networks: %s" % ", ".join(networks)) procs = [] for network in networks: proc = IRCProcess(network) proc.start() procs.append(proc) try: while True: time.sleep(1) for proc in procs: if not proc.is_alive(): procs.remove(proc) if not procs: LOG.info("No longer connected to any networks, shutting down") sys.exit(0) except KeyboardInterrupt: LOG.info("Caught KeyboardInterrupt, shutting down")
def build_options(): """Generate command line options.""" parser = argparse.ArgumentParser(version=version.version_string()) parser.add_argument("-c", "--config", default=get_conf_file_path(), help="specify the path to a configuration file") parser.add_argument("-d", "--debug", action="store_true", help="show debugging output") return parser.parse_known_args()[0]
def reset_output(self): """ Clear all the output console """ #self.output_console.config(state=NORMAL) self.output_console.delete(1.0, END) self.begin() self.write("MrPython v.{} -- mode {}\n".format( version.version_string(), tr(self.mode)))
def reset_output(self): """ Clear all the output console """ #self.output_console.config(state=NORMAL) self.output_console.delete(1.0, END) self.begin() self.write("MrPython v.{} -- mode {}\n".format(version.version_string(), tr(self.mode)))
def build_options(): """Generate command line options""" parser = optparse.OptionParser(version=version.version_string()) parser.add_option("-c", "--config", default=get_conf_file_path(), help="specify the path to a configuration file") parser.add_option("-d", "--debug", action="store_true", help="show debugging output") return parser.parse_args()
def parse_args(argv, default_config_files=None): options.set_defaults(CONF, connection=_DEFAULT_SQL_CONNECTION, sqlite_db='birdie.sqlite') rpc.set_defaults(control_exchange='birdie') debugger.register_cli_opts() CONF(argv[1:], project='birdie', version=version.version_string(), default_config_files=default_config_files) rpc.init(CONF)
def parse_args(argv, default_config_files=None): log.register_options(CONF) options.set_defaults(CONF, connection=_DEFAULT_SQL_CONNECTION, sqlite_db='conveyor.sqlite') rpc.set_defaults(control_exchange='conveyor') debugger.register_cli_opts() CONF(argv[1:], project='conveyor', version=version.version_string(), default_config_files=default_config_files) rpc.init(CONF)
def main(): """Main IRC loop.""" networks = CONFIG.get("networks", type="list") LOG.info("Starting %s" % version.version_string()) LOG.info("Connecting to IRC Networks: %s" % ", ".join(networks)) for network in networks: proc = IRCProcess(network) proc.start() try: while True: time.sleep(1) except KeyboardInterrupt: LOG.info("Caught KeyboardInterrupt, shutting down")
def deploy(version=None, customer=None): """deploy nexiles gateway service jar and web app to server""" if customer: env.customer = customer if "customer" not in env or env.customer is None: raise RuntimeError("no customer specified and env.customer not set.") print "deploying version : " + yellow(env.package_version) print "for customer : " + red(env.customer) deploy_eggs() print "deployed version : " + green(version_string()) print "for customer : " + red(env.customer)
def __init__(self, network): irclib.SimpleIRCClient.__init__(self) network_config = utils.get_config(network) self.log = log.get_logger(str(network)) self.version = version.version_string() self.source = None self.target = None self.addressed = False self.rank = 0 self.names = {} self.admins = CONFIG.get("admins", type="list") self.command_prefix = CONFIG.get("command_prefix") self.reconnect_delay = CONFIG.get("reconnect_delay", type="int") self.rejoin_delay = CONFIG.get("rejoin_delay", type="int") self.server = network_config.get("server") self.password = network_config.get("password", default=None) self.port = network_config.get("port", type="int", default=6667) self.ssl = network_config.get("ssl", type="bool", default=False) self.ipv6 = network_config.get("ipv6", type="bool", default=False) self.bind_to = network_config.get("bind_to", default=None) self.nick = network_config.get("nick") self.username = network_config.get("username", default=None) self.identify_password = network_config.get("identify_password", default=None) self.default_channels = network_config.get("channels", type="list") # make sure to copy the list self.channels = list(self.default_channels) self.load_plugins() self.log.info("Connecting to %s:%d as %s" % (self.server, self.port, self.nick)) self.connect(self.server, self.port, self.nick, self.password, ssl=self.ssl, ipv6=self.ipv6, localaddress=self.bind_to, username=self.username)
def get_paste(paste_id, raw=None): """Fetch and return a paste.""" stats = os.stat(utils.get_directory("pastes") + paste_id) st_mtime = time.ctime(stats.st_mtime) st_size = stats.st_size paste = utils.read_file("pastes", paste_id) if not paste: flask.abort(404) if raw: return flask.Response(paste, status=200, mimetype="text/plain") return flask.render_template_string(PASTE_TEMPLATE, paste_id=paste_id, paste=cgi.escape(paste), st_mtime=st_mtime, st_size=st_size, version=version.version_string())
def get_paste(paste_id, raw=None): """Fetch and return a paste.""" stats = os.stat(utils.get_directory("pastes") + paste_id) st_mtime = time.ctime(stats.st_mtime) st_size = stats.st_size paste = utils.read_file("pastes", paste_id) if not paste: flask.abort(404) if raw: return flask.Response(paste, status=200, mimetype="text/plain") return flask.render_template_string( PASTE_TEMPLATE, paste_id=paste_id, paste=cgi.escape(paste), st_mtime=st_mtime, st_size=st_size, version=version.version_string())
def build(customer=None): """Deploy nexiles gateway service to server""" if customer: customer_list = [customer] else: customer_list = env.customer_list.split() assert "WT_HOME" in os.environ, "Please set WT_HOME!" assert "PYTHONUSERBASE" in os.environ, "Please set PYTHONUSERBASE!" for customer in customer_list: env.customer = customer print "building version: " + yellow(env.package_version) print "for customer : " + red(env.customer) build_eggs() build_pth() build_docs() package_docs() print "built version : " + green(version_string()) print "for customer : " + red(customer_list)
def index(): """Handle index requests.""" return version.version_string(), 200
with open(fname, "r") as f: for line in f: line = line.strip() if line and not line.startswith("#"): ret.append(line) return ret def read_long_description(): with open("README.rst", "r") as f: return f.read() setup( name="libcloud-vagrant", version=version_string(), description="A libcloud compute provider for local Vagrant boxes", long_description=read_long_description(), url="https://github.com/carletes/libcloud-vagrant", author="Carlos Valiente", author_email="*****@*****.**", license="MIT", classifiers=[ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Topic :: Software Development :: Libraries :: Python Modules", "Programming Language :: Python", "Programming Language :: Python :: 2.7",
def parse_args(argv, default_config_files=None): CONF(argv[1:], project='cloudemulator', version=version.version_string(), default_config_files=default_config_files)
from setuptools import setup, find_packages import version static_version, commit_hash, _, build_number = version.version() full_version = version.version_string(static_version, commit_hash, build_number) setup(name="wott-agent", version=full_version, author="Viktor Petersson", author_email="*****@*****.**", description="WoTT agent", packages=find_packages(exclude=('tests', )), include_package_data=True, classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Security', 'Topic :: System :: Installation/Setup', 'Topic :: System :: Networking', 'Topic :: System :: Systems Administration', 'Topic :: Utilities', ], setup_requires=['GitPython'], install_requires=[ 'certifi', 'cffi', 'chardet', 'cryptography', 'idna', 'netifaces', 'psutil', 'pyOpenSSL', 'python-iptables', 'requests', 'sh', 'pytz', 'setuptools', 'systemd-python'
from setuptools import setup, find_packages import version setup( name="wott-agent", version=version.version_string(*version.version()), author="Viktor Petersson", author_email="*****@*****.**", description="WoTT agent", packages=find_packages(exclude=('tests',)), include_package_data=True, classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Security', 'Topic :: System :: Installation/Setup', 'Topic :: System :: Networking', 'Topic :: System :: Systems Administration', 'Topic :: Utilities', ], setup_requires=[ 'GitPython'