示例#1
0
    def __init__(self):
        App.__init__(self)
        self.STACK = ExdStack()

        self._keyboard = Window.request_keyboard(self._keyboard_closed, self)
        self._keyboard.bind(on_key_down=self._on_keyboard_down)
        self.keyEvents = {}
示例#2
0
 def __init__(self):
     App.__init__(self)
     self.l = ""
     self.showData = ""
     self.flag = False
     self.layout = FloatLayout()
     self.new_button = Button(background_color=(0, 0, 0, 0),
                              text='Connected to Server!',
                              color=(0, 0, 0, 1),
                              pos_hint={
                                  'center_x': 0.5,
                                  'center_y': 0.8
                              },
                              size_hint=(.20, .1))
     self.serverError = Button(background_color=(0, 0, 0, 0),
                               text='Cannot connect to Server!',
                               color=(0, 0, 0, 1),
                               pos_hint={
                                   'center_x': 0.5,
                                   'center_y': 0.8
                               },
                               size_hint=(.20, .1))
     self.serverDisconnected = Button(background_color=(0, 0, 0, 0),
                                      text='Disconnected from Server!',
                                      color=(0, 0, 0, 1),
                                      pos_hint={
                                          'center_x': 0.5,
                                          'center_y': 0.8
                                      },
                                      size_hint=(.20, .1))
     self.img = Image(source='bground.jpg',
                      allow_stretch=True,
                      keep_ratio=True)
示例#3
0
    def __init__(self):
        App.__init__(self)
        self.data = HymnData()
        
        self.title = "Old-Line Primitive Baptist Hymn and Tune Book"
        
        self.panel = TabbedPanel()
        
        self.number_tab = TabbedPanelItem(text="By number")
        self.panel.add_widget(self.number_tab)

        self.set_up_number_tab()

        self.panel.default_tab = self.number_tab

        self.first_line_tab = TabbedPanelItem(text="By first line")
        self.panel.add_widget(self.first_line_tab)

        self.set_up_first_line_tab()

        self.search_tab = TabbedPanelItem(text="Search")
        self.panel.add_widget(self.search_tab)
        self.set_up_search_tab()

        self.about_tab = TabbedPanelItem(text="About")
        self.panel.add_widget(self.about_tab)
        self.set_up_about_tab()
示例#4
0
    def __init__(self) -> None:
        App.__init__(self)

        #Allows access to controller class to send signals
        self.Controller = Controller()

        #For GPS/Mapping
        self.TargetInfo = TargetInfo()

        self.tp = None
        self.th_drone_control = None
        self.th_drone_adv_control = None
        self.th_doc = None

        Cache.remove('kv.image')
        Cache.remove('kv.texture')

        image = Image.open("Gmap/default.png")
        temp = image.copy()
        temp.save("Gmap/drone_path.png")

        image = Image.open("images/default_score.png")
        temp = image.copy()
        temp.save("images/scored.png")
        temp.save("images/prescored.png")
示例#5
0
文件: main.py 项目: jefree/SimPlanOS
	def __init__(self):
		App.__init__(self)

		self.screaner = Screnear()
		self.ejecutando = True

		thread.start_new_thread(self.iniciar_sim, ())
示例#6
0
    def __init__(self):
        """

        :return:
        """
        App.__init__(self)

        # Connection
        self.connection = "DUMMY"
        self.proxy = Proxy(self.connection)
        self.proxy.start()

        # Model
        self.robot = SimulatedRobot(self.proxy)
        self.robot.cell_size = 0.3
        self.robot.x = 0.3
        self.robot.y = 0.3

        self.map_model = Map(self.robot, 3.0, 0.3)
        self.state = State.default
        self.brush = "start"

        self.planning_algorithm = GridNav(self.map_model)
        self.planner = Planner(self.robot, self.map_model, self.planning_algorithm, self.proxy)

        # View
        self.map_widget = None
        self.panel_widget = None
        self.toolbar_widget = None
        self.horizontal_layout = None
        self.vertical_layout = None
        self.popup = None

        self.plan()
示例#7
0
 def __init__(self):
     App.__init__(self)
     self.connected = True
     self.Connect((HOST, PORT))
     
     self.count = 0
     self.time = 0
 def __init__(self):
     App.__init__(self)
     self.__triparray = []
     self.__colorarray = []
     self.__colored_index = 0
     self.photos = []
     find_all_photos(self)
示例#9
0
 def __init__(self, *kargs, **kwargs):
     App.__init__(self, *kargs, **kwargs)
     self.connected = True
     self.Connect(('127.0.0.1', 34002))
     
     self.count = 0
     self.time = 0
示例#10
0
文件: ExdApp.py 项目: sne3ks/Exode
    def __init__(self):
        App.__init__(self)
        self.STACK= ExdStack()

        self._keyboard = Window.request_keyboard(self._keyboard_closed, self)
        self._keyboard.bind(on_key_down=self._on_keyboard_down)
        self.keyEvents = {}
示例#11
0
 def __init__(self, **kwargs):
     App.__init__(self, **kwargs)
     self.ids = None
     self.num = 0
     self.working_timers_info = []
     beep_thread = BeepThread(self)
     beep_thread.daemon = True
     beep_thread.start()
示例#12
0
        def __init__(self):
            App.__init__(self)
            #super(LoopsApp, self).__init__()

            if is_master:
                self.title = "Master Display"
            else:
                self.title = "Slave Display"
示例#13
0
 def __init__(self, channel=0, light_behaviour=None, *args, **kwargs):
     App.__init__(self, *args, **kwargs)
     self.channel = channel
     self.input_port = "blah blah"
     self.output_port = "blah blah out"
     self.apc_widget = None
     self.midiport = None
     self.light_behaviour = light_behaviour
    def __init__(self, **kwargs):
        # initialize variables
        self._clipboard = Clipboard
        self.info_bubble = None
        self.nfcscanner = None
        self.tabs = None
        self.is_exit = False
        self.wallet = None  # type: Optional[Abstract_Wallet]
        self.pause_time = 0
        self.asyncio_loop = asyncio.get_event_loop()

        App.__init__(self)  #, **kwargs)

        self.electrum_config = config = kwargs.get('config',
                                                   None)  # type: SimpleConfig
        self.language = config.get('language', 'en')
        self.network = network = kwargs.get('network', None)  # type: Network
        if self.network:
            self.num_blocks = self.network.get_local_height()
            self.num_nodes = len(self.network.get_interfaces())
            net_params = self.network.get_parameters()
            self.server_host = net_params.host
            self.server_port = net_params.port
            self.auto_connect = net_params.auto_connect
            self.oneserver = net_params.oneserver
            self.proxy_config = net_params.proxy if net_params.proxy else {}
            self.update_proxy_str(self.proxy_config)

        self.plugins = kwargs.get('plugins', None)  # type: Plugins
        self.gui_object = kwargs.get('gui_object', None)  # type: ElectrumGui
        self.daemon = self.gui_object.daemon
        self.fx = self.daemon.fx

        self.is_lightning_enabled = bool(config.get('lightning'))

        self.use_rbf = config.get('use_rbf', True)
        self.use_unconfirmed = not config.get('confirmed_only', False)

        # create triggers so as to minimize updating a max of 2 times a sec
        self._trigger_update_wallet = Clock.create_trigger(
            self.update_wallet, .5)
        self._trigger_update_status = Clock.create_trigger(
            self.update_status, .5)
        self._trigger_update_history = Clock.create_trigger(
            self.update_history, .5)
        self._trigger_update_interfaces = Clock.create_trigger(
            self.update_interfaces, .5)

        self._periodic_update_status_during_sync = Clock.schedule_interval(
            self.update_wallet_synchronizing_progress, .5)

        # cached dialogs
        self._settings_dialog = None
        self._password_dialog = None
        self._channels_dialog = None
        self._addresses_dialog = None
        self.fee_status = self.electrum_config.get_fee_status()
        self.request_popup = None
示例#15
0
    def __init__(self):
        App.__init__(self)

        self.font_size = 40
        self.rewarded = False
        self.well_done_sound = SoundLoader.load('well-done-ru.wav')
        self.try_again_sound = SoundLoader.load('try-again-ru.wav')
        self.well_done_sound.volume = 0.3
        self.try_again_sound.volume = 0.3
示例#16
0
文件: ui.py 项目: liucong3/DQN
 def __init__(self,
              gameEnv,
              gameControl,
              displayEnlarged=3,
              bindKeyEvents=True):
     self.gameEnv = gameEnv
     self.gameControl = gameControl
     self.displayEnlarged = displayEnlarged
     App.__init__(self)
 def __init__(self):
     App.__init__(self)
     # dictionary is now global
     # self.dict_local = dictionary
     if is_master:
         self.title = 'Master display'
     else:
         self.title = 'Slave display'
     Clock.schedule_interval(self.update, 1 / 30.)
示例#18
0
 def __init__(self):
     App.__init__(self)
     self.tmp = TooMuchPrivacy()
     self.username = self.tmp.select_keys_and_passphrase()
     self.host = 'fungi.kylegabriel.com'
     self.port = 8000
     self.connection = None
     self.command = None
     self.parameters = None
示例#19
0
文件: main.py 项目: GuySa/Conway
    def __init__(self):
        App.__init__(self)
        self.numOfSteps = 0
        self.isGameRunning = False
        self.boardLayout = GridLayout(cols=BOARD_SIZE)

        # Initializing the board with size BOARD_SIZE+2 by BOARD_SIZE+2.
        # The +2 part puts a boundary around the board to make checking neighbors less exception-inducing
        self.actualBoard = [[0 for _ in range(BOARD_SIZE + 2)]
                            for _ in range(BOARD_SIZE + 2)]
示例#20
0
 def __init__(self):
     App.__init__(self)
     self.range = None
     print("load pkl")
     try:
         if os.path.isfile("range.pkl"):
             with open('range.pkl', 'rb') as f:
                 self.range = pickle.load(f)
     except:
         pass
示例#21
0
    def __init__(self, **kwargs):
        # initialize variables
        self._clipboard = Clipboard
        self.info_bubble = None
        self.nfcscanner = None
        self.tabs = None
        self.is_exit = False
        self.wallet = None
        self.pause_time = 0

        App.__init__(self)  #, **kwargs)

        title = _('Dash Electrum App')
        self.electrum_config = config = kwargs.get('config', None)
        self.language = config.get('language', 'en')
        self.network = network = kwargs.get('network', None)  # type: Network
        self.tor_auto_on = self.electrum_config.get('tor_auto_on', True)
        if self.network:
            self.num_blocks = self.network.get_local_height()
            self.num_nodes = len(self.network.get_interfaces())
            net_params = self.network.get_parameters()
            self.server_host = net_params.host
            self.server_port = net_params.port
            self.auto_connect = net_params.auto_connect
            self.oneserver = net_params.oneserver
            self.proxy_config = net_params.proxy if net_params.proxy else {}
            self.update_proxy_str(self.proxy_config)

        self.plugins = kwargs.get('plugins', [])
        self.gui_object = kwargs.get('gui_object', None)
        self.daemon = self.gui_object.daemon
        self.fx = self.daemon.fx

        self.use_change = config.get('use_change', True)
        self.use_unconfirmed = not config.get('confirmed_only', False)

        # create triggers so as to minimize updating a max of 2 times a sec
        self._trigger_update_wallet = Clock.create_trigger(
            self.update_wallet, .5)
        self._trigger_update_status = Clock.create_trigger(
            self.update_status, .5)
        self._trigger_update_history = Clock.create_trigger(
            self.update_history, .5)
        self._trigger_update_interfaces = Clock.create_trigger(
            self.update_interfaces, .5)

        self._periodic_update_status_during_sync = Clock.schedule_interval(
            self.update_wallet_synchronizing_progress, .5)

        # cached dialogs
        self._settings_dialog = None
        self._password_dialog = None
        self.fee_status = self.electrum_config.get_fee_status()
示例#22
0
文件: app.py 项目: pylover/chakameh
 def __init__(self):
     App.__init__(self)
     self.appdir = os.path.abspath(os.path.dirname(__file__))
     ApplicationInfo.single().last_run = datetime.now()
     session.commit()
     
     self.kv_files = [os.path.join(self.appdir,'views',f) for f in ['global.kv',
                                                                    'player.kv',
                                                                    'rightpane.kv',
                                                                    'playlist.kv',
                                                                    'mediaart.kv',
                                                                    'loading.kv']]
     self.root_kv_file = os.path.join(self.appdir,'views','root.kv')
示例#23
0
    def __init__(self):
        App.__init__(self)
        self.adc = serial.Serial('/dev/ttyUSB0',
                                 timeout=1,
                                 baudrate=115200,
                                 parity=serial.PARITY_NONE,
                                 stopbits=serial.STOPBITS_ONE,
                                 bytesize=serial.EIGHTBITS)

        self.data = "Has not been updated"
        self.MLabel = Label(text=self.data, font_size='40sp')

        Clock.schedule_interval(self.checkSerial, 1)
示例#24
0
    def __init__(self, simObject):
        App.__init__(self)
        self.simObject = simObject
#        pygame.init()
#        self.screen = pygame.display.set_mode((480, 480))
#        self.surface = pygame.Surface((480, 480))

        self.lw = int(math.sqrt(self.simObject.numLights))
        self.lh = int((self.simObject.numLights / self.lw) + 0.5)

        self.lightBuffer = np.zeros((self.lw, self.lh, 3), dtype=int)
#        self.lightSurface = pygame.Surface((self.lw, self.lh))
        print "SimWindow created"
示例#25
0
    def __init__(self, **kwargs):
        # initialize variables
        self._clipboard = Clipboard
        self.info_bubble = None
        self.nfcscanner = None
        self.tabs = None
        self.is_exit = False
        self.wallet = None
        self.pause_time = 0
        self.asyncio_loop = asyncio.get_event_loop()

        App.__init__(self)#, **kwargs)

        title = _('Vialectrum App')
        self.electrum_config = config = kwargs.get('config', None)
        self.language = config.get('language', 'en')
        self.network = network = kwargs.get('network', None)  # type: Network
        if self.network:
            self.num_blocks = self.network.get_local_height()
            self.num_nodes = len(self.network.get_interfaces())
            net_params = self.network.get_parameters()
            self.server_host = net_params.host
            self.server_port = net_params.port
            self.auto_connect = net_params.auto_connect
            self.oneserver = net_params.oneserver
            self.proxy_config = net_params.proxy if net_params.proxy else {}
            self.update_proxy_str(self.proxy_config)

        self.plugins = kwargs.get('plugins', [])
        self.gui_object = kwargs.get('gui_object', None)
        self.daemon = self.gui_object.daemon
        self.fx = self.daemon.fx

        self.use_rbf = config.get('use_rbf', True)
        self.use_change = config.get('use_change', True)
        self.use_unconfirmed = not config.get('confirmed_only', False)

        # create triggers so as to minimize updating a max of 2 times a sec
        self._trigger_update_wallet = Clock.create_trigger(self.update_wallet, .5)
        self._trigger_update_status = Clock.create_trigger(self.update_status, .5)
        self._trigger_update_history = Clock.create_trigger(self.update_history, .5)
        self._trigger_update_interfaces = Clock.create_trigger(self.update_interfaces, .5)

        self._periodic_update_status_during_sync = Clock.schedule_interval(self.update_wallet_synchronizing_progress, .5)

        # cached dialogs
        self._settings_dialog = None
        self._password_dialog = None
        self.fee_status = self.electrum_config.get_fee_status()
示例#26
0
    def __init__(self, **kwargs):
        App.__init__(self, **kwargs)

        self.controller = Controller(target_temp=state.target_temp)
        self.controller.start()

        self.sim_mode = SIM_MODE

        if self.sim_mode:
            from sim import sim_state, start
            self.sim_state = sim_state
            self.sim_state.power = 0
            unblock(start)

        Clock.schedule_interval(self.update, UPDATE_INTERVAL)
示例#27
0
    def __init__(self, **kwargs):
        # initialize variables
        self._clipboard = Clipboard
        self.info_bubble = None
        self.nfcscanner = None
        self.tabs = None
        self.is_exit = False
        self.wallet = None
        self.pause_time = 0

        App.__init__(self)  #, **kwargs)

        title = _('Electrum-LTC App')
        self.electrum_config = config = kwargs.get('config', None)
        self.language = config.get('language', 'en')
        self.network = network = kwargs.get('network', None)
        if self.network:
            self.num_blocks = self.network.get_local_height()
            self.num_nodes = len(self.network.get_interfaces())
            host, port, protocol, proxy_config, auto_connect = self.network.get_parameters(
            )
            self.server_host = host
            self.server_port = port
            self.auto_connect = auto_connect
            self.proxy_config = proxy_config if proxy_config else {}

        self.plugins = kwargs.get('plugins', [])
        self.gui_object = kwargs.get('gui_object', None)
        self.daemon = self.gui_object.daemon
        self.fx = self.daemon.fx

        self.use_rbf = config.get('use_rbf', True)
        self.use_change = config.get('use_change', True)
        self.use_unconfirmed = not config.get('confirmed_only', False)

        # create triggers so as to minimize updating a max of 2 times a sec
        self._trigger_update_wallet = Clock.create_trigger(
            self.update_wallet, .5)
        self._trigger_update_status = Clock.create_trigger(
            self.update_status, .5)
        self._trigger_update_history = Clock.create_trigger(
            self.update_history, .5)
        self._trigger_update_interfaces = Clock.create_trigger(
            self.update_interfaces, .5)
        # cached dialogs
        self._settings_dialog = None
        self._password_dialog = None
        self.fee_status = self.electrum_config.get_fee_status()
示例#28
0
 def __init__( self ):
     App.__init__( self )
     config = ConfigParser.ConfigParser()
     config.read('config.ini')
     self.journal_file = config.get( 'Journal', 'journal_file' )
     self.simple_program_name = config.get('Training program',
                                           'simple_program_name' )
     self.simple_program_last_training = config.getint(
         'Training program', 'simple_program_last_training' )
     if os.path.isfile( self.journal_file ):            
         self.journal = Journal.load_journal( self.journal_file )
     else:
         self.journal = Journal( [], {} )
     self.dict_of_simple_programs = self.read_simple_programs()
     self.simple_program = self.dict_of_simple_programs.get(
         self.simple_program_name )        
示例#29
0
    def __init__(self, **kwargs):
        App.__init__(self, **kwargs)
        self.base_grid_layout = None
        self.user_label = None
        self.middle_grid_layout = None
        self.lower_grid_layout = None
        self.upper_number_grid_layout = None
        self.operation_grid_layout = None

        self.number_order = list('.0789456123')
        self.number_buttons = []

        self.operation_order = list('+−×÷^√')
        self.operation_buttons = []

        self.calculated = False
示例#30
0
 def __init__(self, args, **kwargs):
     App.__init__(self)
     self.panel = None
     self.args = args
     self.manager = None
     """ Thread """
     self.pcapthread = kwargs['pcapthread']
     self.pcapthread.set_application(self)
     self.channelthread = kwargs.get('channelthread', None)
     if self.channelthread:
         self.channelthread.set_application(self)
     """ Keyboard """
     self.shift = False
     self._keyboard = Window.request_keyboard(self._keyboard_closed, self)
     self._keyboard.bind(on_key_down=self._on_keyboard_down)
     self._keyboard.bind(on_key_up=self._on_keyboard_up)
示例#31
0
    def __init__(self):
        self.title = 'Skeleton'
        self.icon = 'assets/img/icon.png'
        self.folder = os.path.dirname(os.path.abspath(__file__))
        # make sure android uses the /sdcard folder instead of data/
        if platform == 'android':
            path = '/sdcard/skeleton/'
#            if not os.path.exists(path):
#                os.mkdir(path)
#            for f in copyfiles:
#                shutil.copyfile(os.path.join('data', f), os.path.join(path, f))
#            self.data_folder = path
        else:
            self.data_folder = os.path.join(self.folder, 'data')

        Factory.register('Notify', cls=Notify)
        App.__init__(self)
示例#32
0
    def __init__(self):
        self.title = 'Skeleton'
        self.icon = 'assets/img/icon.png'
        self.folder = os.path.dirname(os.path.abspath(__file__))
        # make sure android uses the /sdcard folder instead of data/
        if platform == 'android':
            path = '/sdcard/skeleton/'
#            if not os.path.exists(path):
#                os.mkdir(path)
#            for f in copyfiles:
#                shutil.copyfile(os.path.join('data', f), os.path.join(path, f))
#            self.data_folder = path
        else:
            self.data_folder = os.path.join(self.folder, 'data')

        Factory.register('Notify', cls=Notify)
        App.__init__(self)
示例#33
0
 def __init__(self,**kwargs):
     App.__init__(self)
     self.layout = FloatLayout(padding=1,size=(500, 500))
     Config.set('graphics','resizable', False)
     #text output
     self.out = TextInput(font_size=60, text='Select Day', 
                          multiline=True,pos=(0, 360),size_hint=(.75, .4))
     #buttons
     self.day1 = Button(font_size=45, text='Day-1',pos=(600, 480),size_hint=(.25, .2))
     self.day2 = Button(font_size=45, text='Day-2',pos=(600, 360),size_hint=(.25, .2))
     self.wf_fema = Button(font_size=60, text='WF-1',pos=(0, 180),size_hint=(.50, .3))
     self.wf_mafe = Button(font_size=60, text='WF-2',pos=(400, 180),size_hint=(.50, .3))
     self.rsi = Button(font_size=60, text='RS-I',pos=(0, 0),size_hint=(1, .3))
     #list        
     self.lday = [self.day1,self.day2]
     self.ltask = [self.wf_mafe,self.wf_fema,self.rsi]
     self.day = ''
    def __init__(self):
        App.__init__(self)

        self.cols = 28
        self.rows = 28

        self.pos_top = int(Window.height * 0.35)
        self.but_height = float(Window.height / float(6)) / float(
            Window.height)
        self.but_width = float(
            ((Window.width - (Window.height / 2)) / 2) / float(Window.width))
        self.pos_right_but = int(Window.width -
                                 (Window.width * self.but_width) - 10)

        self.outtext = "0"
        self.outheight = 40
        self.bottom = Label(text=self.outtext,
                            size_hint_y=None,
                            height=self.outheight)

        self.list_txt = str("")
        self.label_top = Label(text=self.list_txt,
                               halign="left",
                               valign="top",
                               pos=(10, 10))

        self.mag = 1  # 5
        self.stride = 32  #256
        #self.project = 20

        self.grid = [-1 for i in range(self.stride * self.stride)]
        self.input_grid = [0 for i in range(self.cols * self.rows)]

        self.still_looping = True
        self.load_type = LOAD.ALPHA
        self.load_letter = "A"
        self.touched_screen = False
        self.pos = (0, 0)

        self.process = False

        ##self.cnn =  nn.DualCNN()
        ##self.cnn.load_file()

        self.letter = ""
 def __init__(self):
     """Initialize the user interface."""
     App.__init__(self)
     self.scoreA = 0
     self.scoreB = 0
     self.agentA = "Agent A"
     self.agentAImgDef = "img/agent_1.png"
     self.agentAImg = None
     self.agentB = "Agent B"
     self.agentBImgDef = "img/agent_2.png"
     self.agentBImg = None
     self.wall_img = Image(source="img/wall.png")
     self.trash_img = Image(source="img/trash.png")
     self.map = None
     self.running = False
     self.env = None
     self.counter_steps = 0
     self.initialized = False
 def __init__(self):
     """Initialize the user interface."""
     App.__init__(self)
     self.scoreA = 0
     self.scoreB = 0
     self.agentA = "Agent A"
     self.agentAImgDef = "img/agentA_v0.png"
     self.agentAImg = None
     self.agentB = "Agent B"
     self.agentBImgDef = "img/agentB_v0.png"
     self.agentBImg = None
     self.wall_img = Image(source="img/wall.png")
     self.trash_img = Image(source="img/trash.png")
     self.map = None
     self.running = False
     self.env = None
     self.counter_steps = 0
     self.initialized = False
示例#37
0
    def __init__(self):
        self.title = 'Pocket Philosopher'
        self.icon = 'assets/img/icon.png'
        self.folder = os.path.dirname(os.path.abspath(__file__))
        # make sure android uses the /sdcard folder instead of data/
        if platform == 'android':
            path = '/sdcard/pocketphilosopher/'
            copyfiles = ['aphorisms.json', 'aphorisms-authors.json']
            if not os.path.exists(path):
                os.mkdir(path)
            for f in copyfiles:
                shutil.copyfile(os.path.join('data', f), os.path.join(path, f))
            self.data_folder = path
        else:
            self.data_folder = os.path.join(self.folder, 'data')

        Factory.register('Notify', cls=Notify)
        App.__init__(self)
示例#38
0
    def __init__(self):
        self.title = 'Pocket Philosopher'
        self.icon = 'assets/img/icon.png'
        self.folder = os.path.dirname(os.path.abspath(__file__))
        # make sure android uses the /sdcard folder instead of data/
        if platform == 'android':
            path = '/sdcard/pocketphilosopher/'
            copyfiles = ['aphorisms.json', 'aphorisms-authors.json']
            if not os.path.exists(path):
                os.mkdir(path)
            for f in copyfiles:
                shutil.copyfile(os.path.join('data', f), os.path.join(path, f))
            self.data_folder = path
        else:
            self.data_folder = os.path.join(self.folder, 'data')

        Factory.register('Notify', cls=Notify)
        App.__init__(self)
示例#39
0
    def __init__(self, **kwargs):
        # initialize variables
        self._clipboard = Clipboard
        self.info_bubble = None
        self.nfcscanner = None
        self.tabs = None
        self.is_exit = False
        self.wallet = None
        self.pause_time = 0

        App.__init__(self)#, **kwargs)

        title = _('Electrum App')
        self.electrum_config = config = kwargs.get('config', None)
        self.language = config.get('language', 'en')
        self.network = network = kwargs.get('network', None)
        if self.network:
            self.num_blocks = self.network.get_local_height()
            self.num_nodes = len(self.network.get_interfaces())
            host, port, protocol, proxy_config, auto_connect = self.network.get_parameters()
            self.server_host = host
            self.server_port = port
            self.auto_connect = auto_connect
            self.proxy_config = proxy_config if proxy_config else {}

        self.plugins = kwargs.get('plugins', [])
        self.gui_object = kwargs.get('gui_object', None)
        self.daemon = self.gui_object.daemon
        self.fx = self.daemon.fx

        self.use_rbf = config.get('use_rbf', True)
        self.use_change = config.get('use_change', True)
        self.use_unconfirmed = not config.get('confirmed_only', False)

        # create triggers so as to minimize updating a max of 2 times a sec
        self._trigger_update_wallet = Clock.create_trigger(self.update_wallet, .5)
        self._trigger_update_status = Clock.create_trigger(self.update_status, .5)
        self._trigger_update_history = Clock.create_trigger(self.update_history, .5)
        self._trigger_update_interfaces = Clock.create_trigger(self.update_interfaces, .5)
        # cached dialogs
        self._settings_dialog = None
        self._password_dialog = None
        self.fee_status = self.electrum_config.get_fee_status()
示例#40
0
 def __init__(self):
     App.__init__(self)
     self.root_widget = RelativeLayout()
     self.bg_texture = CoreImage('bg.jpg').texture
     self.bg_rect = Rectangle(texture=self.bg_texture,
                              pos=self.root_widget.pos,
                              size=Window.size)
     self.root_widget.canvas.add(self.bg_rect)
     Window.bind(size=self.on_size)
     self.determine_font_size()
     self.menu_widget = MenuWidget(self)
     self.verses = []
     self.verses_widget = VersesWidget(self)
     self.options_widget = OptionsWidget(self)
     self.add_verse_widget = AddVerseWidget(self)
     self.memorize_widget = MemorizeWidget(self)
     self.verse_widget = VerseWidget(self)
     self.add_verse_popup = Popup(title='Add Verse',
                                  content=Label(text='Fetching verse...'))
示例#41
0
 def __init__(self):
     App.__init__(self)
     Window.clearcolor = BG_COLOR
     self.metronome = MetronomeWidget(1, False)
     self.title = 'Intuitive Metronome (IM)'
     self.layout = GridLayout(cols=1, padding=10)
     self.config_button = Button(text="Configure",
                                 font_size=24,
                                 size_hint_x=0.35,
                                 bold=True,
                                 color=TEXT_COLOR,
                                 background_color=CONFIGURE_COLOR)
     self.mode = 'Moving Block'
     self.accomp = False
     self.selected_file = None
     self.viz_feedback = None
     self.accomp_feedback = None
     self.file_chooser = FileSelector()
     Clock.schedule_interval(self.update, 1)
示例#42
0
 def __init__(self):
     Callbacks.__init__(self)
     App.__init__(self)
     self.session = EvernoteSession()
     self.places = []
     self.conditions = {}
     self.results = None
     self.root = BoxLayout(orientation='vertical', spacing=10)
     self.place_spinner = ComboEdit(hint_text='Specify place')
     self.conditions_btn = Button(text='Conditions', id='conditions')
     self.search_btn = Button(text='Search!')
     self.add_item_btn = Button(text='Add Item', on_press=self.add_item_btn_callback, disabled=False)
     self.header_grid = GridLayout(cols=2, size_hint=(1, 0.05))
     self.results_panel = None
     self.results_scroll = ScrollView(size_hint=(1, None), size=(Window.width, Window.height * 0.55))
     self.results_grid = GridLayout(cols=1)
     self.save_btn = Button(text='Save', on_press=self.save_callback, disabled=True)
     self.reset_btn = Button(text='Reset', on_press=self.reset_callback, disabled=True)
     Window.softinput_mode = 'below_target'
示例#43
0
    def __init__(self, **kwargs):
        """
        Sets up members
        """
        App.__init__(self, **kwargs)
        self._screen = None

        # Load the Hardware class
        self.Hardware = autoclass('org.renpy.android.Hardware')

        # Load the Context class
        self.Context = autoclass('android.content.Context')

        # Load the activity class
        PythonActivity = autoclass('org.renpy.android.PythonActivity')
        # Get the current activity instance
        self.__activity = PythonActivity.mActivity

        # The Wifi multicast lock
        self.__multicast_lock = None
示例#44
0
文件: main.py 项目: dallongo/pyRESTvk
    def __init__(self):
    	# search in local path to script, first
        settings_file = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), 'settings.json'))
        # commandline arg should be relative to current working directory
        if len(sys.argv) == 2:
            settings_file = os.path.abspath(os.path.join(os.getcwd(), os.path.expandvars(sys.argv[1])))
        if not os.path.isfile(settings_file) or not os.path.getsize(settings_file) > 0:
            Logger.error("init: File Not Found '{0}'".format(settings_file))
            sys.exit(1)

        # read settings from file
        with open(settings_file) as f:
	        settings = json.load(f)

        # check all needed settings keys exist
        for k in ['mappings', 'profile', 'auth_key', 'server_url']:
            if k not in settings:
                Logger.error("init: Missing Key '{0}' in '{1}'".format(k, settings_file))
                sys.exit(1)

        # resolve file paths relative to settings file
        for k in settings:
            if k in ['mappings', 'profile', 'kv_file']:
                settings[k] = os.path.abspath(os.path.join(os.path.dirname(settings_file), os.path.expandvars(settings[k])))
                if not os.path.isfile(settings[k]) or not os.path.getsize(settings[k]) > 0:
                    Logger.error("init: File Not Found '{0}'".format(settings[k]))
                    sys.exit(1)

        # set kv_file if override exists
        k = settings.pop('kv_file', None)
        if k:
        	self.kv_file = k
        self.settings = settings

        # our init is done, call parent class init to finish
        App.__init__(self)
        return
    def __init__(self):
        App.__init__(self)

        self.cols = 28
        self.rows = 28

        self.pos_top = int(Window.height * 0.35)
        self.but_height = float(Window.height / float(6))/float(Window.height)
        self.but_width = float( ((Window.width - ( Window.height / 2))/2)/float(Window.width))
        self.pos_right_but = int(Window.width - (Window.width* self.but_width ) - 10)

        self.outtext = "0"
        self.outheight = 40
        self.bottom = Label(text = self.outtext, size_hint_y = None, height = self.outheight)

        self.list_txt = str("")
        self.label_top = Label(text=self.list_txt, halign="left", valign="top", pos=(10 , 10))

        self.mag = 1    # 5
        self.stride = 32 #256
        #self.project = 20

        self.grid = [ -1 for i in range (self.stride * self.stride) ]
        self.input_grid = [ 0 for i in range (self.cols * self.rows) ]

        self.still_looping = True
        self.load_type = LOAD.ALPHA
        self.load_letter = "A"
        self.touched_screen = False
        self.pos = (0,0)

        self.process = False
        
        ##self.cnn =  nn.DualCNN()
        ##self.cnn.load_file()
        
        self.letter = ""
示例#46
0
 def __init__(self, character, controller):
     self.character = character
     self.controller = controller
     App.__init__(self)
示例#47
0
 def __init__(self):
     App.__init__(self)
     self.ad_call = False
     self.called = False
示例#48
0
文件: app.py 项目: TadLeonard/bewth
 def __init__(self, *args, img_path=".", **kwargs):
     App.__init__(self, *args, **kwargs)
     self.img_path = img_path
     self.view = view.BewthView()
     view.clear_img(self.view)
示例#49
0
    def __init__(self, cfg):
        App.__init__(self)

        self.cfg = cfg
        self.current_tab = None
示例#50
0
 def __init__(self, mc):
     self.mc = mc
     App.__init__(self)
示例#51
0
    def __init__(self, return_val, fd):

        App.__init__(self)
        self.return_val = return_val
        self.fd = fd
示例#52
0
文件: kivmap.py 项目: TimSC/kivmap
	def __init__(self, **args):

		App.__init__(self, **args)

		Window.bind(on_resize=self.on_resize)
示例#53
0
    def __init__(self):
        App.__init__(self)

        Window.bind(on_keyboard=self.key_handler)
示例#54
0
 def __init__(self):
     App.__init__(self)
     self.control_window = None
示例#55
0
 def __init__(self):
     App.__init__(self)