Esempio n. 1
0
 def krpc_connect(self):
     logger.info('Connecting to KSP...')
     try:
         Core.client().connect(ip=self.ip_input.text,
                               rpc_port=int(self.rpc_port_input.text),
                               stream_port=int(self.stream_port_input.text))
     except (KrappErrorOSConnection, KrappErrorConnection):
         ErrorPopup().open()
Esempio n. 2
0
 def initialize(self, dt):
     Core.client().add_observer(self)
Esempio n. 3
0
"""Run example application."""

import sys
import logging

from containers import Core, Application

if __name__ == '__main__':
    # Configure platform:
    Core.config.update({
        'database': {
            'dsn': ':memory:'
        },
        'aws': {
            'access_key_id': 'KEY',
            'secret_access_key': 'SECRET'
        },
        'auth': {
            'token_ttl': 3600
        }
    })
    Core.logger().addHandler(logging.StreamHandler(sys.stdout))

    # Run application:
    Application.main(uid=sys.argv[1], password=sys.argv[2], photo=sys.argv[3])
Esempio n. 4
0
 def initialize(self, dt):
     Core.client().add_observer(self)  # Register as observer
Esempio n. 5
0
from bluetoothscanner import BluetoothTinySineScanner
import dependency_injector.providers as providers

Core.config.override(
    dict(target='id1',
         max_disconnect_pings=5,
         period=5,
         presence={'filename': 'blueping.txt'},
         bluetoothtinysinescanner={
             'port': 'com14',
             'baudrate': 115200,
             'serial_timeout_seconds': 30
         }))

# configure logger
Core.logger().setLevel(logging.DEBUG)
logFormatter = logging.Formatter("%(asctime)s %(message)s")
consoleHandler = logging.StreamHandler()
consoleHandler.setFormatter(logFormatter)
Core.logger().addHandler(consoleHandler)
dateTag = datetime.datetime.now().strftime("%Y-%b-%d_%H-%M-%S")
fileHandler = logging.FileHandler("{0}-{1}.txt".format("log", dateTag))
fileHandler.setFormatter(logFormatter)
Core.logger().addHandler(fileHandler)

# configure presence logger
Core.presence_logger().setLevel(logging.INFO)
presenceFileHandler = logging.FileHandler(Core.config.presence.filename())
presenceFileHandler.setFormatter(logFormatter)
Core.presence_logger().addHandler(presenceFileHandler)
Esempio n. 6
0
 def stage(self):
     Core.client().stage()
Esempio n. 7
0
 def on_enter(self, *args):
     Screen.on_enter(self, *args)
     Core.client().add_altitude_callback(self.update_altitude)