Пример #1
0
def setup_default_app(args, loop):
    def signal_handler():
        loop.stop()
        sys.exit(0)

    loop.add_signal_handler(SIGINT, signal_handler)
    setup_logging(args.system_id)
    logging.getLogger("pogoservice").setLevel(logging.DEBUG)
    log = logging.getLogger(__name__)
    log.setLevel(logging.DEBUG)
    args.player_locale = {'country': 'DE', 'language': 'de', 'timezone': 'Europe/Berlin'}
    args.status_name = args.system_id
    setup_proxies(args)
    set_account_db_args(args, loop)
    set_gymdb_args(args)

    if "overflow_hash_key" in args and args.overflow_hash_key:
        set_goman_hash_endpoint(args.overflow_hash_key)
    install_thread_excepthook()
Пример #2
0
add_webhooks(parser)
add_geofence(parser)

args = parser.parse_args()
load_proxies(args)
set_args(args)
set_account_db_args(args)

pokemonhandler.set_args(args)
position = location(args)
args.player_locale = gmaps_reverse_geolocate(
    args.gmaps_key, args.locale,
    str(position[0]) + ', ' + str(position[1]))

install_thread_excepthook()

stop_at = None
if args.stop_at:
    dur_str = "100:00:00"
    h, m = list(map(int, args.stop_at.split(':')))
    stop_at = datetime.now().replace(hour=h, minute=m)
    msg = "Stopping at {}".format(str(stop_at))
    if stop_at < datetime.now():
        stop_at += timedelta(days=1)
        msg = "Stopping at {} (tomorrow)".format(str(stop_at))
    log.info(msg)

# update_missing_s2_ids()
# update_missing_altitudes(args.gmaps_key)