from src import gk from src.daemonize import daemonize from src.notifier import Notifier from src.gmail import GMail import os, sys import gobject, gtk if (__name__ == "__main__"): APP_NAME = 'multi-gmail-notifier' APP_PASS = '******' CHECK = 60 * 5 if not(len(sys.argv) > 1 and sys.argv[1] == '--no-daemon'): daemonize() config = gk.GK(APP_NAME, APP_PASS); config.unlock_app() notifier = Notifier(sys.path[0], CHECK) for u in config.get_users(): m = GMail(u['item'].get_display_name(), u['item'].get_secret(), u['attr']['uri']) notifier.accounts.append(m) config.lock_app() try: notifier.run()
from src.server.server import Server from src.daemonize import daemonize DEFAULT_CONFIG_PATH = '/etc/rhn/osad/osad_server.cfg' if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('-c', '--config', default=DEFAULT_CONFIG_PATH, dest='config_file', help='configuration file') parser.add_argument('-d', '--daemon', dest='daemon', action='store_true', help='run as daemon', default=False) args = parser.parse_args() config = ServerConfig(args.config_file) server = Server(config) if args.daemon: daemonize(server) else: try: server.start() finally: server.stop()
from src.server.config import ServerConfig from src.server.server import Server from src.daemonize import daemonize DEFAULT_CONFIG_PATH = '/etc/rhn/osad/osad_server.cfg' if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('-c', '--config', default=DEFAULT_CONFIG_PATH, dest='config_file', help='configuration file') parser.add_argument('-d', '--daemon', dest='daemon', action='store_true', help='run as daemon', default=False) args = parser.parse_args() config = ServerConfig(args.config_file) server = Server(config) if args.daemon: daemonize(server) else: try: server.start() finally: server.stop()
from src.client.config import ClientConfig from src.client.client import Client from src.daemonize import daemonize DEFAULT_CONFIG_FILE = '/etc/sysconfig/rhn/osad.conf' if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('-c', '--config', default=DEFAULT_CONFIG_FILE, dest='config_file', help='alternative configuration file') parser.add_argument('-d', '--daemon', dest='daemon', action='store_true', help='run as daemon', default=False) args = parser.parse_args() config = ClientConfig(args.config_file) client = Client(config) if args.daemon: daemonize(client) else: try: client.start() finally: client.stop()
from src.client.client import Client from src.daemonize import daemonize DEFAULT_CONFIG_FILE = '/etc/sysconfig/rhn/osad.conf' if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('-c', '--config', default=DEFAULT_CONFIG_FILE, dest='config_file', help='alternative configuration file') parser.add_argument('-d', '--daemon', dest='daemon', action='store_true', help='run as daemon', default=False) args = parser.parse_args() config = ClientConfig(args.config_file) client = Client(config) if args.daemon: daemonize(client) else: try: client.start() finally: client.stop()