Example #1
0
    def build(self):
        Config.set('graphics', 'width', '550')
        Config.set('graphics', 'height', '400')
        Config.write()

        board = BoardUI()
        return board
Example #2
0
  def sendwifi(self):
    if self.check.active == True:
      Config.set("account", "user", self.user.text)
      Config.set("account", "password", self.password.text)
      Config.write()

    url1 = "http://fju1.auth.fju.edu.tw/auth/index.html/u"
    url2 = "http://fju2.auth.fju.edu.tw/auth/index.html/u"
    url3 = "http://fju3.auth.fju.edu.tw/auth/index.html/u"
    url4 = "http://fju4.auth.fju.edu.tw/auth/index.html/u"
    url5 = "http://fju5.auth.fju.edu.tw/auth/index.html/u"
    url6 = "http://fju6.auth.fju.edu.tw/auth/index.html/u"
    senddata = "?user="******"&password="******"FJU Wi-Fine :)", content=Label(text="FJU Wi-Fi Data Send Success!!"),size_hint=(None, None), size=(450,300))

    for i in range(0,2):
      UrlRequest(url1+senddata)
      UrlRequest(url2+senddata)
      UrlRequest(url3+senddata)
      UrlRequest(url4+senddata)
      UrlRequest(url5+senddata)
      UrlRequest(url6+senddata)

    popup.open()
 def configure_kivy_app():
     """
     Konfiguration fuer das Kivy-Window, http://kivy.org/docs/api-kivy.player.html
     """
     Config.set('kivy', 'exit_on_escape', 1)
     Config.set('graphics', 'resizable', 0)
     Config.write()
Example #4
0
    def build(self):
        config = self.config

        # Input
        if config.getboolean("input", "tuio"):
            try:
                KivyConfig.get("input", "tuiotouchscreen")
            except (NoSectionError, NoOptionError):
                KivyConfig.set('input', 'tuiotouchscreen', 'tuio,0.0.0.0:3333')
                KivyConfig.write()
        if config.getboolean("input", "touch"):
            # Enable mouse interface
            kv_filename = 'gameoflife-nontuio.kv'
        else:
            kv_filename = 'gameoflife-tuio.kv'

        # Game
        self.speed = config.getint("game", "speed")
        self.iterations_per_turn = config.getint("game", "iterations_per_turn")
        self.top_score = config.getint("game", "top_score")
        self.minimum_pieces = config.getint("game", "minimum_pieces")

        # Root widget
        self.root = Builder.load_file(kv_filename)
        self.root.app = self

        # Grid
        self.root.grid.rows = config.getint("grid", "rows")
        self.root.grid.cols = config.getint("grid", "cols")
        self.root.grid.cell_size = config.getint("grid", "cell_size")
Example #5
0
    def build(self):
        Config.set('graphics', 'width', '550')
        Config.set('graphics', 'height', '400')
        Config.write()

        board = BoardUI()
        Clock.schedule_interval(board.update, .1)
        return board
Example #6
0
	def init_config(self):
		Config.set("graphics", "fullscreen", 0)
		Config.set("graphics", "resizable", 0)
		Config.set("graphics", "height", 600)
		Config.set("graphics", "width", 600)
		Config.set("kivy", "exit_on_escape", 0)
		Config.set("input", "mouse", "mouse,multitouch_on_demand")
		Config.write()
Example #7
0
 def load(self, path, filename, start_height):
     self.last_directory = path
     Config.set('internal', 'last_directory', self.last_directory)
     Config.write()
     self.dismiss_popup()
     App.get_running_app().last_print.set("file", filename)
     self.parent.current = 'printingui'
     self.parent.printing_ui.print_file(filename, start_height)
Example #8
0
File: shader.py Project: lhl/vrdev
 def save(self):
   print('---')
   print(self._win.win)
   print('---')
   Config.set('graphics', 'height', self.size[0])
   Config.set('graphics', 'width', self.size[1])
   Config.set('graphics', 'top', self.top)
   Config.set('graphics', 'left', self.left)
   Config.write()
Example #9
0
	def build(self):
	
		Config.set("graphics", "fullscreen", 0)
		Config.set("graphics", "resizable", 0)
		Config.set("graphics", "height", 600)
		Config.set("graphics", "width", 600)
		Config.set("kivy", "exit_on_escape", 0)
		Config.write()
		
		return TicTacToeGame()
Example #10
0
    def build(self):
        Config.set('graphics', 'width', '550')
        Config.set('graphics', 'height', '400')
        Config.write()

        board = BoardUI()
        Clock.schedule_interval(board.update, 1.0/60.0)
        anim = Animation(x=550, duration=3.)
        anim.start(board.ball)
        return board
Example #11
0
def main():
    from font_render.app import FontRenderApp

    Config.set("kivy", "log_level", "debug")
    Config.write()

    try:
        FontRenderApp().run()
    except:
        exc = get_exception(full_tb=True)
        Logger.exception(str(exc))
Example #12
0
 def build(self):
     Config.set('graphics','maxfps','300')
     Config.set('graphics','width','384')
     Config.set('graphics','height','640')
     Config.write()
     sm = ScreenManager(transition=FadeTransition())
     st = StartScreen(name='st')
     gs = GameScreen(name='gs')
     sm.add_widget(st)
     sm.add_widget(gs)
     #sm.switch_to(st)
     #Clock.schedule_interval(game.update,1/60.0)
     return sm
Example #13
0
    def __init__(self, **kwargs):
        super(KeyboardTest, self).__init__(**kwargs)
        #self._add_numeric()  # Please see below
        self._add_keyboards()
        self._keyboard = None

        #TODO: Remove or document?
        Logger.info("main.py: keyboard_mode=" +
                    Config.get("kivy", "keyboard_mode"))
        Config.set("kivy", "keyboard_mode", "dock")
        Config.write()
        Logger.info("main.py: 2. keyboard_mode=" +
                    Config.get("kivy", "keyboard_mode"))
Example #14
0
 def _save(self):
     Config.set(self.section, 'camera_focal_length_mm', str(self.camera_focal_length_mm))
     Config.set(self.section, 'sensor_size_x_mm', str(self.sensor_size_x_mm))
     Config.set(self.section, 'sensor_size_y_mm', str(self.sensor_size_y_mm))
     Config.set(self.section, 'focal_point_to_center', str(self.focal_point_to_center))
     Config.set(self.section, 'laser_intersection_degree_1', str(self.laser_intersection_degree_1))
     Config.set(self.section, 'laser_intersection_degree_2', str(self.laser_intersection_degree_2))
     Config.set(self.section, 'laser_intersection_degree_3', str(self.laser_intersection_degree_3))
     Config.set(self.section, 'laser_intersection_degree_4', str(self.laser_intersection_degree_4))
     Config.set(self.section, 'laser_intersection_degree_5', str(self.laser_intersection_degree_5))
     Config.set(self.section, 'laser_intersection_distance_1', str(self.laser_intersection_distance_1))
     Config.set(self.section, 'laser_intersection_distance_2', str(self.laser_intersection_distance_2))
     Config.set(self.section, 'laser_intersection_distance_3', str(self.laser_intersection_distance_3))
     Config.set(self.section, 'laser_intersection_distance_4', str(self.laser_intersection_distance_4))
     Config.set(self.section, 'laser_intersection_distance_5', str(self.laser_intersection_distance_5))
     Config.write()
Example #15
0
	def build(self):

		Config.set('kivy','keyboard_mode','')
		Config.write()
		self.general_screen = GeneralScreen(name="General")
		self.home_screen = HomeScreen(name="Home")
		self.login_screen = LogInScreen(name="LogIn")
		self.singup_screen = SignUpScreen(name="SignUp")
		self.profile_screen = ProfileScreen(name="Profile")
		self.map_screen=MapScreen(name="Map")
		sm.add_widget(self.map_screen)
		sm.add_widget(self.home_screen)
		sm.add_widget(self.login_screen)
		sm.add_widget(self.singup_screen)
		sm.add_widget(self.profile_screen)
		sm.add_widget(self.general_screen)
		sm.current = "Home"
		
		return sm
Example #16
0
def _set_config(fullscreen=None,
                locked=None,
                framerate=None,
                fontname=None,
                fontsize=None,
                data_dir=None):
    if fullscreen is not None:
        Config.set("SMILE", "FULLSCREEN", fullscreen)
    if locked is not None:
        Config.set("SMILE", "LOCKEDSUBJID", locked)
    if framerate is not None:
        Config.set("SMILE", "FRAMERATE", float(framerate))
    if fontname is not None:
        Config.set("SMILE", "FONTNAME", fontname)
    if fontsize is not None:
        Config.set("SMILE", "FONTSIZE", fontsize)
    if data_dir is not None:
        Config.set("SMILE", "DEFAULT_DATA_DIR", data_dir)
    Config.write()
Example #17
0
    def build(self):
        self.dispatch("on_gui_build")

        self.root = Root()

        self.karlabel = self.root.karlabel
        self.image = self.root.image
        self.tb = self.root.tb

        Config.set("graphics", "fullscreen", self.config.get("Karaokivy", "fullscreen"))
        Config.write()

        self.root.remove_widget(self.karlabel)

        self.root.volume.bind(percentage=self.setter("volume"))
        self.root.pitch.bind(percentage=self.setter("pitch"))
        self.root.speed.bind(percentage=self.setter("speed"))

        self.dispatch("on_gui_built")

        return self.root
Example #18
0
    def on_config_change(self, *args, **kwargs): # config, section, key, value):
        #print args, kwargs
        try:
            section = args[-3]
            key = args[-2]
            value = args[-1]

            if section == "graphics" and key == "fullscreen":
                self.config.set("Karaokivy", key, (value in ("auto", "yes", "1", "fake") and "auto" or "0"))
                self.config.write()
                self._needsrestart = True
            elif section == "Karaokivy" and key == "fullscreen":
                Config.set("graphics", key, value)
                Config.write()
                self._needsrestart = True
            elif section == "Karaokivy" and False:
                pass

        ######################### FIXME ##########################

        except IndexError:
            print args, kwargs
Example #19
0
	def build(self):

		Config.set('kivy','keyboard_mode','')
		Config.write()
		print "window:"
		self.width = Config.getint('graphics','width')
		self.height= Config.getint('graphics','height')
		self.general_screen = GeneralScreen(name="General")
		self.home_screen = HomeScreen(name="Home")
		self.login_screen = LogInScreen(name="LogIn")
		self.singup_screen = SignUpScreen(name="SignUp")
		self.profile_screen = ProfileScreen(name="Profile")
		self.map_screen=MapScreen(name="Map")
		sm.add_widget(self.map_screen)
		sm.add_widget(self.home_screen)
		sm.add_widget(self.login_screen)
		sm.add_widget(self.singup_screen)
		sm.add_widget(self.profile_screen)
		sm.add_widget(self.general_screen)
		sm.current = "LogIn"
		
		return sm
    def build(self):
        
        #load kv file
        Builder.load_file('layout/sns.kv')
        Builder.load_file('layout/sns_popup.kv')
        Builder.load_file('layout/channel_view.kv')
        Builder.load_file('layout/scrollLayoutView.kv')
        Builder.load_file('layout/channel_list_layout.kv')
        Builder.load_file('layout/post_status.kv')
        
        self.sns = SNS(name='sns')
        #self.channel = Channel(name='channel')
        #self.sns.snsdata.append({'content':"Hi", 'title':'Testing1'})
        
        self.load_channel()
        self.transition = SlideTransition(duration=.35)
        root = ScreenManager(transition=self.transition)
        root.add_widget(self.sns)
        
        Config.read('config.ini')
        
        Config.set('graphics', 'height','1280')
        Config.set('graphics', 'width','720')
        
        Config.set('kivy','log_level','debug')
        Config.set('kivy','log_dir','logs')
        Config.set('kivy','log_enable ','1')
        Config.set('kivy','log_name','kivy_%y-%m-%d_%_.txt')
        Config.write()
        
        self.choose_status_index = 0
        Clock.schedule_interval(self.sns.save_status_feedback,5)
        
        time.clock()

        #for s in sp.home_timeline(10):
            #self.sns.insert_status(s)
        
        return root
Example #21
0
    def reset_state(self):
        self.canvas.clear()
        self.dt = self.ticks = 0
        self.runtime = 0.0
        self.pew_list = []
        self.enemy_list = []
        self.last_pew = -10.0
        self.player = Player(60, self.canvas)
        self.player.update(self.dt)
        self.last_touch = None
        self.touch_uids = []
        self.game_over = False
        self.game_over_toogle = 0

        if self.points > self.top_points:
            self.top_points = self.points
            Config.set('records', 'top_points', str(self.top_points))
            Config.write()
        self.draw_score(str(self.top_points), where=self.SCORE_WHERE_TOPRIGHT)
        self.points = 0

        Clock.unschedule(self.toogle_score)
        Clock.schedule_interval(self.update, 1.0/60)
        self.draw_score(str(0))
Example #22
0
 def on_resize(self, win, width, height):
     Config.set('graphics', 'width', width)
     Config.set('graphics', 'height', height)
     Config.write()
Example #23
0
                args += ['']
            Config.set('modules', args[0], args[1])
        elif opt in ('-s', '--save'):
            need_save = True
        elif opt in ('-r', '--rotation'):
            Config.set('graphics', 'rotation', arg)
        elif opt in ('-d', '--debug'):
            level = LOG_LEVELS.get('debug')
            Logger.setLevel(level=level)
        elif opt == '--dpi':
            environ['KIVY_DPI'] = arg

    if need_save and 'KIVY_NO_CONFIG' not in environ:
        try:
            with open(kivy_config_fn, 'w') as fd:
                Config.write(fd)
        except Exception as e:
            Logger.exception(
                'Core: error while saving default'
                'configuration file:', str(e))
        Logger.info('Core: Kivy configuration saved.')
        sys.exit(0)

    # configure all activated modules
    from kivy.modules import Modules
    Modules.configure()

    # android hooks: force fullscreen and add android touch input provider
    if platform in ('android', 'ios'):
        from kivy.config import Config
        Config.set('graphics', 'fullscreen', 'auto')
Example #24
0
def OrcaConfigParser_On_Setting_Change(config, section, key, value):

    uValue = ToUnicode(value)

    if section == "ORCA":
        if   key == u'button_clear_atlas':
            ClearAtlas()
        elif key == u"button_notification":
            uNotification = value.split("_")[-1]
            Globals.oNotifications.SendNotification(uNotification,**{"key":key,"value":value})
        elif key == u'button_discover_rediscover':
            if uValue == u'button_discover_rediscover':
                Globals.oInterFaces.DiscoverAll()
            else:
                Globals.oInterFaces.DiscoverAll(bForce=True)
        elif key == u'button_discover_results':
            from ORCA.utils.Discover import cDiscover_List
            Globals.oApp.oDiscoverList = cDiscover_List()
            Globals.oApp.oDiscoverList.ShowList()
        elif key == u'button_getonline':
            Globals.oTheScreen.AddActionShowPageToQueue(uPageName=u'Page_Settings_Download')
        elif key == u'button_installed_reps':
            Globals.oDownLoadSettings.LoadDirect(uValue, True)
        elif key == u'button_show_installationhint':
            Var_DeleteCookie('SHOWINSTALLATIONHINT', Globals.uDefinitionName)
            Globals.oTheScreen.AddActionToQueue([{'string': 'call', 'actionname': 'Fkt ShowInstallationHint'}])
        elif key == u'button_show_licensefile':
            SetVar(uVarName="SHOWFILE", oVarValue=ReplaceVars("$var(LICENSEFILE)"))
            Globals.oTheScreen.AddActionShowPageToQueue(uPageName=u'Page_ShowFile')
        elif key == u'button_show_credits':
            SetVar(uVarName="SHOWFILE", oVarValue=ReplaceVars("$var(CREDITSFILE)"))
            Globals.oTheScreen.AddActionShowPageToQueue(uPageName=u'Page_ShowFile')
        elif key == u'button_show_logfile':
            SetVar(uVarName="SHOWFILE", oVarValue=ReplaceVars("$var(LOGFILE)"))
            Globals.oTheScreen.AddActionShowPageToQueue(uPageName=u'Page_ShowFile')
        elif key == u'button_show_powerstati':
            Globals.oTheScreen.AddActionShowPageToQueue(uPageName=u'Page_PowerStati')
        elif key == u'button_updateallreps':
            Globals.oDownLoadSettings.UpdateAllInstalledRepositories(True)
        elif key == u'language':
            # Changes the languages, reloads all strings and reloads the settings dialog
            Globals.uLanguage = uValue
            Globals.oApp.InitPathes()
            Globals.oNotifications.SendNotification("on_language_change")
        elif key == u'locales':
            Globals.uLocalesName = uValue
            Globals.oTheScreen.LoadLocales()
        elif key == u'startrepeatdelay':
            Globals.fStartRepeatDelay = float(uValue)
        elif key == u'longpresstime':
            Globals.fLongPressTime = float(uValue)
        elif key == u'contrepeatdelay':
            Globals.fContRepeatDelay = float(uValue)
        elif key == u'clockwithseconds':
            Globals.bClockWithSeconds = (uValue == '1')
        elif key == u'longdate':
            Globals.bLongDate = (uValue == '1')
        elif key == u'longday':
            Globals.bLongDay = (uValue == '1')
        elif key == u'longmonth':
            Globals.bLongMonth = (uValue == '1')
        elif key == u'checkfornetwork':
            Globals.bConfigCheckForNetwork = (uValue == '1')
        elif key == u'vibrate':
            Globals.bVibrate = (uValue == '1')
        elif key == u'interface':
            if uValue == 'select':
                return
            Globals.oTheScreen.uInterFaceToConfig = uValue
            if Globals.oInterFaces.dInterfaces.get(uValue) is None:
                Globals.oInterFaces.LoadInterface(uValue)
            Globals.oTheScreen.AddActionShowPageToQueue(uPageName=u'Page_InterfaceSettings')
            Globals.oOrcaConfigParser.set(u'ORCA', key, u'select')
            Globals.oOrcaConfigParser.write()
        elif key == u'script':
            if uValue == 'select':
                return
            uScript = u''
            Globals.oOrcaConfigParser.set(u'ORCA', key, 'select')
            Globals.oOrcaConfigParser.write()

            tValue = uValue.split(':')
            uValue = tValue[0]
            if len(tValue) > 1:
                uScript = tValue[1]

            # Configure
            if uValue == ReplaceVars('$lvar(516)'):
                Globals.oTheScreen.uScriptToConfig = uScript
                Globals.oTheScreen.AddActionShowPageToQueue(uPageName=u'Page_ScriptSettings')

            # Run
            if uValue == ReplaceVars('$lvar(517)'):
                kwargs = {"caller": "settings"}
                Globals.oScripts.RunScript(uScript,**kwargs)
            Globals.oOrcaConfigParser.set(u'ORCA', key, u'select')
            Globals.oOrcaConfigParser.write()

        elif key == u'definition':
            ShowQuestionPopUp(uTitle='$lvar(599)', uMessage='$lvar(5026)', fktYes=Globals.oApp.on_config_change_change_definition, uStringYes='$lvar(5001)', uStringNo='$lvar(5002)')
        elif key == u'skin':
            Globals.oApp.ReStart()
        elif key == u'rootpath':
            if not Globals.bInit:
                Globals.oApp.close_settings()
                Globals.oApp._app_settings = None
                kivyConfig.write()
                Clock.schedule_once(Globals.oApp.Init_ReadConfig, 0)
            else:
                ShowMessagePopUp(uMessage=u'$lvar(5011)')
        elif key.startswith(u'soundvolume_'):
            uSoundName = key[12:]
            Globals.oSound.SetSoundVolume(uSoundName, ToInt(uValue))
            Globals.oSound.PlaySound(uSoundName)
        elif key == u'button_changedefinitionsetting':
            Globals.uDefinitionToConfigure = uValue[7:]
            Globals.oTheScreen.AddActionShowPageToQueue(uPageName=u'Page_DefinitionSettings')
        else:
            ShowMessagePopUp(uMessage=u'$lvar(5011)')

        # todo: check , if this required anymore
    elif section == Globals.uDefinitionName:
        if key in Globals.oDefinitions.aDefinitionSettingVars:
            SetVar(uVarName = key, oVarValue = value)
        ShowMessagePopUp(uMessage=u'$lvar(5011)')
Example #25
0
    def build(self):
        Config.set('graphics', 'width', '500')
        Config.set('graphics', 'height', '400')
        Config.write()

        return AppBoxLayout()
Example #26
0
def set_window():
    Config.set("graphics", "resizable", False)
    Config.set("graphics", "width", window_width)
    Config.set("graphics", "height", window_height)
    Config.write()
Example #27
0
class KivyUI(App):

# CONFIGURATION
	Config.set('kivy', 'keyboard_mode', 'systemanddock')
	Config.set('kivy', 'keyboard_layout', 'email.json')
	Config.write()
# APP VARIABLES
	myCommand = None

	CID = "0"
	balance = "0.00"
	email = ""
	device = ""

	detected = False
	connected = False
	scannerConnected = False
	purchase = 0
	connectionStatus = "Disconnected"
	scannerStatus = "Disconnected"
	loginID = "admin"
	password = "******"

	tree = None
	root = None

	presentation = Builder.load_file("manager.kv")
# COMMON SCREEN FUNCTIONS
	def updateCIDValue(self, newCID):
		self.CID = newCID
	def updateConnectionStatus(self):
		if self.myCommand.connected:
			self.connected = True
			self.connectionStatus = "Connected"
		else:
			self.connected = False
			self.connectionStatus = "Disconnected"
	def updateScannerStatus(self):
		if self.myCommand.s_connected:
			self.scannerConnected = True
			self.scannerStatus = "Connected"
		else:
			self.scannerConnected = False 
			self.scannerStatus = "Disconnected"
	def sendToServer(self, text):
		self.myCommand.execute(text)
# BOOTUP FUNCTIONS
	def login(self, userLogin, userPassword):
		if (userLogin == self.loginID) & (userPassword == self.password):
			return True
		else:
			return False
# DEMO MENU FUNCTIONS
	def blankCard(self):
		self.myCommand.execute('S0')
	def cardBlanked(self):
		pass
# CACHE FUNCTIONS
	def updateCache(self):
		self.myCommand.execute('77')
		self.tree = ET.parse('database.xml')
		self.data = self.tree.getroot()
	def isCustomerInCache(self, custCID):
		isIn = False
		self.tree = ET.parse('database.xml')
		self.data = self.tree.getroot()
		for c in self.data.findall('Customer'):
			if (c.find('CID').text == custCID) or (('0'+c.find('CID').text) == custCID):
				isIn = True
		return isIn
	def getCustomerFromCache(self, custCID):
		self.tree = ET.parse('database.xml')
		self.data = self.tree.getroot()
		for c in self.data.findall('Customer'):
			if (c.find('CID').text == custCID) or (('0'+c.find('CID').text) == custCID):
				self.CID = custCID
				self.balance = "$%.2f" % float(c.find('Balance').text)
				self.email = c.find('Email').text
			else:
				pass
	def isEmailInCache(self, custEmail):
		isIn = False
		self.tree = ET.parse('database.xml')
		self.data = self.tree.getroot()
		for c in self.data.findall('Customer'):
			if (c.find('Email').text == custEmail):
				isIn = True
		return isIn
# CONNECTION SETTINGS FUNCTIONS 
	def setHost(self, HOST):
		command = 'c7 '
		command += HOST
		self.myCommand.execute(command)
	def serverConnect(self, serverID, serverPassword):
		self.myCommand.execute('c2')
		self.myCommand.execute('c8 '+serverID+' '+serverPassword)
	def serverDisconnect(self):
		self.myCommand.execute('c3')
# CUSTOMER MENU FUNCTIONS
	def scannerPoll(self):
		self.updateCache()
		time.sleep(1)
		self.myCommand.execute('S1')
# CUSTOMER MENU EXIST FUNCTIONS
	def cardRegistered(self):
		message = "Your pass has been successfully registered!"
		self.getCustomerFromCache(self.CID)
		self.presentation.updateCustomerLabels(self.CID, self.balance, self.email, message, "1")
		self.presentation.current = "CustomerInfo"
	def cardUpdated(self):
		message = "Your balance has been updated!"
		self.getCustomerFromCache(self.CID)
		self.presentation.updateCustomerLabels(self.CID, self.balance, self.email, message, self.device)
		self.presentation.current = "CustomerInfo"
# CUSTOMER INSERT BLANK FUNCTIONS
	def detectedIncorrect(self):
		self.presentation.updateMessageLabel("This NFC pass is not a properly formatted E-Pass.")
	def detectedBlank(self):
		if self.presentation.current == "CustomerInsertBlank":
			self.presentation.current = "CustomerRegister"
		else:
			self.presentation.updateMessageLabel("This pass is blank.")
# CUSTOMER INSERT EXIST FUNCTIONS
	def detectedExisting(self, CID, device):
		if self.isCustomerInCache(CID):
			if self.presentation.current == "CustomerInsertExist":
				self.CID = CID
				self.device = device
				self.getCustomerFromCache(CID)
				self.presentation.updateCustomerLabels(self.CID, self.balance, self.email, "", self.device)
				self.presentation.current = "CustomerInfo"
			else:
				self.presentation.updateMessageLabel("This pass is already in use.")
		else:
			self.presentation.updateMessageLabel("This pass was reported lost/broken and has been removed from the database.")
# CUSTOMER REGISTER FUNCTIONS
	def register(self, EMAIL, PURCHASE):
		if self.scannerConnected:
			self.CID = "0"
			command = 'c4 '
			command += EMAIL + ' '
			command += PURCHASE
			self.myCommand.execute(command)
			time.sleep(1.5)
			self.updateCache()
			time.sleep(1)
			command = 'S2' + self.CID + PURCHASE
			self.myCommand.execute(command)
		else:
			pass
	def getServerCID(self, newCID):
		self.CID = newCID
# CUSTOMER UPDATE BALANCE FUNCTIONS
	def update(self, PURCHASE):
		command = 'c5 '
		command += self.CID + ' '
		command += PURCHASE
		self.myCommand.execute(command)
		time.sleep(1.5)
		self.updateCache()
		time.sleep(1)
		command = 'S3' + PURCHASE
		self.myCommand.execute(command)
# CUSTUMER DELETE FUNCTIONS
	def delete(self, EMAIL):
		command = 'c6 '
		command += EMAIL
		self.myCommand.execute(command)
		time.sleep(1.5)
		self.updateCache()
# APP FUNCTIONS
	def build(self):
		return self.presentation
	def setCommand(self, myCommandHandler):
		self.myCommand = myCommandHandler
	def display(self, String):
		pass
	def exit(self):
		App.get_running_app().stop()	
	if __name__ == '__main__':
		KivyUI().run()
# END OF PROGRAM
Example #28
0
                args += ['']
            Config.set('modules', args[0], args[1])
        elif opt in ('-s', '--save'):
            need_save = True
        elif opt in ('-r', '--rotation'):
            Config.set('graphics', 'rotation', arg)
        elif opt in ('-d', '--debug'):
            level = LOG_LEVELS.get('debug')
            Logger.setLevel(level=level)
        elif opt == '--dpi':
            environ['KIVY_DPI'] = arg

    if need_save and 'KIVY_NO_CONFIG' not in environ:
        try:
            with open(kivy_config_fn, 'w') as fd:
                Config.write(fd)
        except Exception as e:
            Logger.exception('Core: error while saving default'
                             'configuration file:', str(e))
        Logger.info('Core: Kivy configuration saved.')
        sys.exit(0)

    # configure all activated modules
    from kivy.modules import Modules
    Modules.configure()

    # android hooks: force fullscreen and add android touch input provider
    if platform in ('android', 'ios'):
        from kivy.config import Config
        Config.set('graphics', 'fullscreen', 'auto')
        Config.remove_section('input')
Example #29
0
 def on_pause(self, *args):
     Config.write()
     return True
Example #30
0
 def on_stop(self, *args):
     self.save_position()
     Config.write()
Example #31
0
 def on_stop(self):
     if self.desktop:
       Config.set('graphics', 'height', Window.height)
       Config.set('graphics', 'width', Window.width)        
     Config.write()
     return True
 def save(self):
     Logger.info("Saving Laser Detection Info")
     Config.write()
Example #33
0
 def on_pre_enter(self):
     Config.set('graphics', 'resizable', '0')
     Config.write()
     Window.size = (225, 400)
 def show_cursor(self):
     # subprocess.check_output(["tput", "cnorm"])
     # self.output('\x1b[34h\x1b[?25h'a)
     Config.set('graphics', 'show_cursor', '1')
     Config.write()
Example #35
0
def config_window():
    # Config.set('graphics', 'window_state', 'maximized')
    Config.set('graphics', 'window_state', 'visible')
    Config.write()
    # Config.set('graphics', 'fullscreen', 'auto')
    Config.set('graphics', 'fullscreen', 'fake')
    Config.write()
    Config.set('graphics', 'width', '3500')
    Config.write()
    Config.set('graphics', 'height', '3000')
    Config.write()
    # Config.set('graphics', 'rotation', '270')
    Config.set('graphics', 'rotation', '0')
    Config.write()
    # Config.set('graphics','borderless', '1') #off
    Config.set('graphics', 'borderless', '0')
    Config.write()
    Config.set('graphics', 'left', '0')
    Config.write()
    Config.set('graphics', 'top', '3000')
    Config.write()
Example #36
0
 def setWindowDimension(self, width, height):
     Config.set('graphics', 'resizable', 0)
     Config.set('graphics', 'width', width)
     Config.set('graphics', 'height', height)
     Config.write()
Example #37
0
import time

from kivy.app import App
from kivy.lang import Builder
from kivy.uix.screenmanager import Screen, ScreenManager
from kivy.uix.gridlayout import GridLayout
from kivy.config import Config
from kivy.clock import Clock
from kivy.core.window import Window
from kivy.uix.popup import Popup
from kivy.uix.button import Button
from kivy.utils import get_color_from_hex as hex

Config.set('graphics', 'width', '480')
Config.set('graphics', 'height', '480')
Config.write()

toaster = ToastNotifier()
counter = 1
ticker = ''


def stock_price_checker(ticker):
    result = requests.get(
        'https://www.finance.yahoo.com/quote/{a}'.format(a=ticker),
        headers=requests.utils.default_headers())
    html = BeautifulSoup(result.text, 'lxml')
    price = html.find(
        class_="Trsdu(0.3s) Trsdu(0.3s) Fw(b) Fz(36px) Mb(-4px) D(b)")

    if price == None: return None
Example #38
0
        kivyconfig.set('modules', 'cursor', '1')

# Initialise mouse support if required
if int(config['Display']['Cursor']):
    kivyconfig.set('graphics', 'show_cursor', '1')
    if config['System']['Hardware'] == 'Pi4':
        kivyconfig.set('input', 'mouse', 'mouse')
        kivyconfig.remove_option('input', 'mtdev_%(name)s')
        # kivyconfig.remove_option('input', 'hid_%(name)s')
else:
    kivyconfig.set('graphics', 'show_cursor', '0')
    if config['System']['Hardware'] == 'Pi4':
        kivyconfig.remove_option('input', 'mouse')

# Save wfpiconsole Kivy configuration file
kivyconfig.write()

# ==============================================================================
# IMPORT REQUIRED CORE KIVY MODULES
# ==============================================================================
from kivy.properties         import ConfigParserProperty, StringProperty
from kivy.properties         import DictProperty, NumericProperty
from kivy.core.window        import Window
from kivy.factory            import Factory
from kivy.logger             import Logger
from kivy.clock              import Clock
from kivy.lang               import Builder
from kivy.app                import App

# ==============================================================================
# IMPORT REQUIRED LIBRARY MODULES
Example #39
0
 def build(self):
     Config.set('graphics', 'resizable', '0')
     Config.write()
     return KeyboardWidget()
Example #40
0
 def build(self):
     Config.set("kivy", "keyboard_mode", 'dock')
     Config.write()
     self.set_layout('numeric.json')
     self.input = ''
Example #41
0
    def _on_keyboard_down(self, keyboard, keycode, text, modifiers):
        '''
        print(keycode)
        print(text)
        print(modifiers)
        '''

        if self.event_once and self.event_once.is_triggered:
            # self.event_once.get_callback()()
            self.event_once.cancel()

        # format_string = self.printer.format_string
        # data = self.printer.data
        def to_prev(*args, **kwargs):
            '''
            print(f'callback for {modifiers}')
            '''
            #self.printer.format_string = str(format_string)
            #self.printer.data = dict(data)
            '''
            if self._keyboard_modifiers and not kwargs.get('recur'):
                # print(self._keyboard_modifiers)
                self.event_once = Clock.create_trigger(partial(to_prev, recur=True), 1)
                self.printer.print(format_string + ' key=[{key}]',
                                   key='+'.join(self._keyboard_modifiers).upper())
                self.event_once()
            else:
                self.printer.print()
            '''
            self.printer.print(key_form='')

        # self.event_once = Clock.create_trigger(to_prev, 1)
        self.event_once = Clock.create_trigger(
            lambda *args: self.printer.print(key_form=''), 1)
        if keycode[1] not in modifiers:
            self.event_once()
        text = modifiers + ([
            keycode[1],
        ] if keycode[1] not in modifiers else [])
        self.printer.print(key='+'.join(text).upper(),
                           key_form=self.printer.data['key_form_default'])

        self._keyboard_modifiers = modifiers

        if 'shift' in modifiers:
            # Rotate
            if 'left' == keycode[1] or 276 == keycode[0]:
                _, pos, _, _ = self.root.sum_attrib()
                self.root.rotate(-ANGLE, (1., 0., 0), (0., 0., 1.), pos)
            if 'right' == keycode[1] or 275 == keycode[0]:
                _, pos, _, _ = self.root.sum_attrib()
                self.root.rotate(ANGLE, (1., 0., 0), (0., 0., 1.), pos)
            if 'down' == keycode[1] or 274 == keycode[0]:
                _, pos, _, _ = self.root.sum_attrib()
                self.root.rotate(ANGLE, (0., 1., 0), (0., 0., 1.), pos)
            if 'up' == keycode[1] or 273 == keycode[0]:
                _, pos, _, _ = self.root.sum_attrib()
                self.root.rotate(-ANGLE, (0., 1., 0), (0., 0., 1.), pos)
        elif not modifiers:

            # Debug
            if 'd' == keycode[1] or 100 == keycode[0]:
                self.root.show_acc = not self.root.show_acc
                self.root.show_vel = not self.root.show_vel
                sublevels = ('Log', 'Debug')
                debug_format = ' mass={mass} pos={pos} vel={vel} acc={acc}'
                self.printer.print(
                    sublevel=sublevels[self.root.show_acc],
                    debug=debug_format if self.root.show_acc else '')

            # Exit
            if 'escape' == keycode[1] or 27 == keycode[0] or \
                    'q' == keycode[1] or 113 == keycode[0]:
                del self.printer

                Config.set('graphics', 'position', 'custom')
                Config.set('graphics', 'width', Window.width)
                Config.set('graphics', 'height', Window.height)
                Config.set('graphics', 'left', Window.left)
                Config.set('graphics', 'top', Window.top)
                Config.write()

                App.get_running_app().stop()

            # Speed
            if 'left' == keycode[1] or 276 == keycode[0]:
                self.time_mult -= 0.1
                self.printer.print(speed=self.time_mult)
                if self.time_mult_pause:
                    self.time_mult_pause = None
            if 'right' == keycode[1] or 275 == keycode[0]:
                self.time_mult += 0.1
                self.printer.print(speed=self.time_mult)
                if self.time_mult_pause:
                    self.time_mult_pause = None
            if 'spacebar' == keycode[1] or 32 == keycode[0]:
                if self.time_mult_pause:
                    self.time_mult, self.time_mult_pause = self.time_mult_pause, None
                else:
                    self.time_mult, self.time_mult_pause = 0., self.time_mult

            # Speed and Position to zero
            if 'down' == keycode[1] or 274 == keycode[0]:
                self.root.set_vel([0.])
                _, _, vel, _ = self.root.sum_attrib()
                self.printer.print(vel=self.nparray2string(vel))
            if 'up' == keycode[1] or 273 == keycode[0]:
                self.root.set_pos(Window.center)
                _, pos, _, _ = self.root.sum_attrib()
                self.printer.print(vel=self.nparray2string(pos))

        return self.root._on_keyboard_down(keyboard, keycode, text, modifiers)
Example #42
0
 def build(self):
     self.icon = 'data/logo.png'
     Config.set('graphics', 'width', '1000')
     Config.set('graphics', 'height', '1000')
     Config.write()
     return page_controller
Example #43
0
 def accept_disclaimer(self):
     Config.set('internal', 'disclaimer', True)
     Config.write()
     self._disclaimer.dismiss()
Example #44
0
 def save_settings(self):
     Logger.info('Saving Settings')
     Config.write()
Example #45
0
 def accept_disclaimer(self):
     Config.set('internal', 'disclaimer', True)
     Config.write()
     self._disclaimer.dismiss()
Example #46
0
 def build(self):
     Config.set('graphics', 'resizable', '0')
     Config.write()
     return CalculatorWidget()
Example #47
0
def start():
    import os
    os.environ["KIVY_NO_ARGS"] = "1"
    os.environ["KIVY_NO_CONSOLELOG"] = "1"

    import kivy
    kivy.require('1.9.1')  # replace with your current kivy version !

    from kivy.app import App
    from kivy.clock import Clock
    from kivy.properties import StringProperty
    from kivy.properties import ObjectProperty
    from kivy.uix.boxlayout import BoxLayout
    from kivy.uix.tabbedpanel import TabbedPanel
    from kivy.uix.floatlayout import FloatLayout
    from kivy.uix.tabbedpanel import TabbedPanelItem

    from kivy.config import Config

    import octoprint.server as Server

    import threading

    from .status import StatusTab
    from .control import ControlTab
    from .files import FilesTab
    from .printer import PrinterTab
    from .. import conf

    Config.set('graphics', 'height', '480')
    Config.set('graphics', 'width', '800')
    Config.set('graphics', 'borderless', '0')
    Config.write()

    class OctoprintLcd(FloatLayout):

        conf = ObjectProperty(None)

        def __init__(self):
            super(OctoprintLcd, self).__init__()

            self.conf = conf

            Clock.schedule_interval(self.update, 0.5)

        def update(self, dt):
            self.conf = conf
            self.ids.status_tab.update(dt)
            self.ids.status_box.update(dt)
            self.ids.control_tab.update(dt)
            self.ids.printer_tab.update(dt)
            self.ids.files_tab.update(dt)

        def switchDefault(self):
            self.ids.tabbedpanel.switch_to(self.ids.tabbedpanel.default_tab)

    class OctoprintLcdApp(App):
        def build(self):
            return OctoprintLcd()

    OctoprintLcdApp.run(OctoprintLcdApp())
Example #48
0
def start():
    import os
    os.environ["KIVY_NO_ARGS"] = "1"
    os.environ["KIVY_NO_CONSOLELOG"] = "1"

    import kivy
    kivy.require('1.9.1') # replace with your current kivy version !

    from kivy.app import App
    from kivy.clock import Clock
    from kivy.properties import StringProperty
    from kivy.properties import ObjectProperty
    from kivy.uix.boxlayout import BoxLayout
    from kivy.uix.tabbedpanel import TabbedPanel
    from kivy.uix.floatlayout import FloatLayout
    from kivy.uix.tabbedpanel import TabbedPanelItem

    from kivy.config import Config

    import octoprint.server as Server

    import threading

    from .status import StatusTab
    from .control import ControlTab
    from .files import FilesTab
    from .printer import PrinterTab
    from .. import conf

    Config.set('graphics', 'height', '480')
    Config.set('graphics', 'width', '800')
    Config.set('graphics', 'borderless', '0')
    Config.write()

    class OctoprintLcd(FloatLayout):

        conf  = ObjectProperty(None)

        def __init__(self):
            super(OctoprintLcd, self).__init__()

            self.conf = conf

            Clock.schedule_interval(self.update, 0.5)

        def update(self, dt):
            self.conf = conf
            self.ids.status_tab.update(dt)
            self.ids.status_box.update(dt)
            self.ids.control_tab.update(dt)
            self.ids.printer_tab.update(dt)
            self.ids.files_tab.update(dt)

        def switchDefault(self):
            self.ids.tabbedpanel.switch_to(self.ids.tabbedpanel.default_tab)

    class OctoprintLcdApp(App):

        def build(self):
            return OctoprintLcd()


    OctoprintLcdApp.run(OctoprintLcdApp())
Example #49
0
def run_app():
    Config.set('graphics', 'width', str(WIDTH))
    Config.set('graphics', 'height', str(HEIGHT))
    Config.set('graphics', 'resizable', '0')
    Config.write()
    DTLApp().run()
Example #50
0
    def InitAndReadSettingsPanel(self) -> bool:
        """
        Reads the complete settings from the orca.ini file
        it will set setting defaults, if we do not have an ini file by now
        """
        try:
            if Globals.oParameter.oPathLog.string:
                oPathLogfile = Globals.oParameter.oPathLog
                oPathLogfile.Create()
                kivyConfig.set('kivy', 'log_dir', oPathLogfile.string)
                kivyConfig.write()
                # uOrgLogFn=Logger.manager.loggerDict["kivy"].handlers[1].filename
                Logger.debug(u"Init: Replacing Logfile Location to :" +
                             Globals.oParameter.oPathLog.string)

            Logger.level = Logger.level

            Globals.fDoubleTapTime = ToFloat(
                kivyConfig.getint('postproc', 'double_tap_time')) / 1000.0
            self.oFnConfig = cFileName(Globals.oPathRoot) + u'orca.ini'

            oConfig = Globals.oOrcaConfigParser
            oConfig.filename = self.oFnConfig.string
            if self.oFnConfig.Exists():
                oConfig.read(self.oFnConfig.string)

            if not oConfig.has_section(u'ORCA'):
                oConfig.add_section(u'ORCA')

            Globals.uDefinitionName = Config_GetDefault_Str(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'definition',
                vDefaultValue=u'setup')
            if "[" in Globals.uDefinitionName:
                Globals.uDefinitionName = Globals.uDefinitionName[
                    Globals.uDefinitionName.find("[") +
                    1:Globals.uDefinitionName.find("]")]

            if Globals.uDefinitionName == u'setup':
                Logger.setLevel(logging.DEBUG)

            oRootPath = Config_GetDefault_Path(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'rootpath',
                uDefaultValue=Globals.oPathRoot.string)
            if oRootPath.string:
                Globals.oPathRoot = oRootPath
            oFnCheck = cFileName(Globals.oPathRoot +
                                 'actions') + 'actionsfallback.xml'
            if not oFnCheck.Exists():
                Globals.oPathRoot = OS_GetUserDataPath()

            Logger.debug(u'Init: Override Path:' + Globals.oPathRoot)

            self.InitRootDirs()
            Globals.iLastInstalledVersion = Config_GetDefault_Int(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption='lastinstalledversion',
                uDefaultValue=Globals.uVersion)

            # The protected file /flag indicates, that we are in the development environment, so we will not download anything from the repository
            Globals.bProtected = (Globals.oPathRoot + u'protected').Exists()
            if Globals.bProtected:
                SetVar(uVarName="PROTECTED", oVarValue="1")
            else:
                SetVar(uVarName="PROTECTED", oVarValue="0")

            # get the installed interfaces , etc
            i = 0
            while True:
                oInstalledRep = cInstalledReps()
                uKey = u'installedrep%i_type' % i
                oInstalledRep.uType = Config_GetDefault_Str(oConfig=oConfig,
                                                            uSection=u'ORCA',
                                                            uOption=uKey,
                                                            vDefaultValue='')
                uKey = u'installedrep%i_name' % i
                oInstalledRep.uName = Config_GetDefault_Str(oConfig=oConfig,
                                                            uSection=u'ORCA',
                                                            uOption=uKey,
                                                            vDefaultValue='')
                uKey = u'installedrep%i_version' % i
                oInstalledRep.iVersion = Config_GetDefault_Int(
                    oConfig=oConfig,
                    uSection=u'ORCA',
                    uOption=uKey,
                    uDefaultValue="0")

                if not oInstalledRep.uName == '':
                    uKey = '%s:%s' % (oInstalledRep.uType, oInstalledRep.uName)
                    Globals.dInstalledReps[uKey] = oInstalledRep
                    i += 1
                else:
                    break

            del Globals.aRepositories[:]

            # get the configured repos
            for i in range(Globals.iCntRepositories):
                if i == 0:
                    uDefault = 'https://www.orca-remote.org/repositories/ORCA_$var(REPVERSION)/repositories'
                else:
                    uDefault = ''
                uKey = u'repository' + str(i)
                uRep = ReplaceVars(
                    Config_GetDefault_Str(oConfig=oConfig,
                                          uSection=u'ORCA',
                                          uOption=uKey,
                                          vDefaultValue=uDefault))
                Globals.aRepositories.append(uRep)

                # we add some values for state, which helps for the Download Settings
                uKey = u'repository_state' + str(i)
                Config_GetDefault_Str(oConfig=oConfig,
                                      uSection=u'ORCA',
                                      uOption=uKey,
                                      vDefaultValue='1')

            # Getting the lists for skins, definitions and languages
            Globals.aSkinList = self.oPathSkinRoot.GetFolderList()
            Globals.aLanguageList = Globals.oPathLanguageRoot.GetFolderList()
            Globals.aDefinitionList = Globals.oPathDefinitionRoot.GetFolderList(
            )
            Globals.uSkinName = Config_GetDefault_Str(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'skin',
                vDefaultValue=u'ORCA_silver_hires')
            self.uSoundsName = Config_GetDefault_Str(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'sounds',
                vDefaultValue=u'ORCA_default')
            Globals.uLanguage = Config_GetDefault_Str(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'language',
                vDefaultValue=OS_GetLocale())
            Globals.bShowBorders = Config_GetDefault_Bool(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'showborders',
                uDefaultValue=u'0')
            Globals.uDefinitionContext = Globals.uDefinitionName

            # this is temporary as some screen animation do not work in the final WINDOwS package (pyinstaller package)
            uDefaultType: str = "fade"
            if Globals.uPlatform == "win":
                uDefaultType = "no"

            Globals.uDefaultTransitionType = Config_GetDefault_Str(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'defaulttransitiontype',
                vDefaultValue=uDefaultType)
            Globals.uDefaultTransitionDirection = Config_GetDefault_Str(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'defaulttransitiondirection',
                vDefaultValue="left")

            if Globals.uDefinitionName == 'setup':
                Logger.setLevel(logging.DEBUG)

            if not Globals.uLanguage in Globals.aLanguageList:
                if len(Globals.aLanguageList) > 0:
                    Globals.uLanguage = Globals.aLanguageList[0]
            oConfig.set(u'ORCA', u'language', Globals.uLanguage)

            Globals.uLocalesName = Config_GetDefault_Str(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'locales',
                vDefaultValue=u'UK (12h)')

            if 'shared_documents' in Globals.aDefinitionList:
                Globals.aDefinitionList.remove('shared_documents')

            if not Globals.uDefinitionName in Globals.aDefinitionList:
                if len(Globals.aDefinitionList) > 0:
                    Globals.uDefinitionName = Globals.aDefinitionList[0]
                    oConfig.set(u'ORCA', u'definition',
                                Globals.uDefinitionName)

            if not Globals.uSkinName in Globals.aSkinList:
                if len(Globals.aSkinList) > 0:
                    Globals.uSkinName = Globals.aSkinList[0]

            oConfig.set(u'ORCA', u'skin', Globals.uSkinName)
            oConfig.set(u'ORCA', u'interface', ReplaceVars("select"))
            oConfig.set(u'ORCA', u'script', ReplaceVars("select"))
            oConfig.set(u'ORCA', u'definitionmanage', ReplaceVars("select"))

            Globals.bInitPagesAtStart = Config_GetDefault_Bool(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'initpagesatstartup',
                uDefaultValue=u'0')
            Globals.fDelayedPageInitInterval = Config_GetDefault_Float(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'delayedpageinitinterval',
                uDefaultValue=u'60')
            Globals.fStartRepeatDelay = Config_GetDefault_Float(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'startrepeatdelay',
                uDefaultValue=u'0.8')
            Globals.fContRepeatDelay = Config_GetDefault_Float(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'contrepeatdelay',
                uDefaultValue=u'0.2')
            Globals.fLongPressTime = Config_GetDefault_Float(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'longpresstime',
                uDefaultValue=u'1')
            Globals.bConfigCheckForNetwork = Config_GetDefault_Bool(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'checkfornetwork',
                uDefaultValue=u'1')
            Globals.uNetworkCheckType = Config_GetDefault_Str(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'checknetworktype',
                vDefaultValue=OS_GetDefaultNetworkCheckMode())
            Globals.uConfigCheckNetWorkAddress = Config_GetDefault_Str(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'checknetworkaddress',
                vDefaultValue='auto')
            Globals.bClockWithSeconds = Config_GetDefault_Bool(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'clockwithseconds',
                uDefaultValue=u'1')
            Globals.bLongDate = Config_GetDefault_Bool(oConfig=oConfig,
                                                       uSection=u'ORCA',
                                                       uOption=u'longdate',
                                                       uDefaultValue=u'0')
            Globals.bLongDay = Config_GetDefault_Bool(oConfig=oConfig,
                                                      uSection=u'ORCA',
                                                      uOption=u'longday',
                                                      uDefaultValue=u'0')
            Globals.bLongMonth = Config_GetDefault_Bool(oConfig=oConfig,
                                                        uSection=u'ORCA',
                                                        uOption=u'longmonth',
                                                        uDefaultValue=u'0')
            Globals.bVibrate = Config_GetDefault_Bool(oConfig=oConfig,
                                                      uSection=u'ORCA',
                                                      uOption=u'vibrate',
                                                      uDefaultValue=u'0')
            Globals.bIgnoreAtlas = Config_GetDefault_Bool(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'ignoreatlas',
                uDefaultValue=u'0')
            Globals.fScreenSize = Config_GetDefault_Float(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'screensize',
                uDefaultValue=u'0')

            if Globals.fScreenSize == 0:
                Globals.fScreenSize = math.sqrt(
                    Globals.iAppWidth**2 + Globals.iAppHeight**2) / Metrics.dpi

            self.InitOrientationVars()
            Globals.uStretchMode = Config_GetDefault_Str(
                oConfig=oConfig,
                uSection=u'ORCA',
                uOption=u'stretchmode',
                vDefaultValue=OS_GetDefaultStretchMode())
            Globals.oSound.ReadSoundVolumesFromConfig(oConfig=oConfig)
            oConfig.write()

            self.InitPathes()  # init all used pathes

            # clear cache in case of an update
            if self.bClearCaches:
                ClearAtlas()

            # Create and read the definition ini file
            Globals.oDefinitionConfigParser = OrcaConfigParser()

            Globals.oDefinitionConfigParser.filename = Globals.oDefinitionPathes.oFnDefinitionIni.string
            if Globals.oDefinitionPathes.oFnDefinitionIni.Exists():
                Globals.oDefinitionConfigParser.read(
                    Globals.oDefinitionPathes.oFnDefinitionIni.string)
            uSection = Globals.uDefinitionName
            uSection = uSection.replace(u' ', u'_')
            if not Globals.oDefinitionConfigParser.has_section(uSection):
                Globals.oDefinitionConfigParser.add_section(uSection)
            return True

        except Exception as e:
            uMsg = u'Global Init:Unexpected error reading settings:' + ToUnicode(
                e)
            Logger.critical(uMsg)
            ShowErrorPopUp(uTitle='InitAndReadSettingsPanel: Fatal Error',
                           uMessage=uMsg,
                           bAbort=True,
                           uTextContinue='',
                           uTextQuit=u'Quit')
            return False
Example #51
0
 def setup(self):
     if self.platform not in ('ios','android'):
         from kivy.config import Config
         Config.set('graphics', 'width', '1000')
         Config.set('graphics', 'height', '700')
         Config.write()
Example #52
0
import configurator as config

# Kivy Configuration
KivyConfig.set('kivy', 'desktop',
               0)  # Disable OS-specific features for testing
KivyConfig.set('kivy', 'keyboard_mode',
               'systemanddock')  # Allow barcode scanner and
# on screen keyboard
KivyConfig.set('graphics', 'height',
               480)  # Set window size to be the same as touchscreen
KivyConfig.set('graphics', 'width', 800)  # (not used when fullscreen enabled)
CLOCK_TYPE = "default"
KivyConfig.set('kivy', 'kivy_clock', CLOCK_TYPE)
KivyConfig.set('graphics', 'maxfps', 250)
KivyConfig.write()


class GranuScreenManager(ScreenManager):
    pass


class MainApp(App):
    def build(self):
        sm = GranuScreenManager(transition=NoTransition())
        return sm


if __name__ == "__main__":
    config.load()  # Load our own app preferences
    # Run the App
Example #53
0
    def toggle_fs(self, win, _dt=None):
        win.fullscreen = 'auto' if not win.fullscreen else False

        Config.set('graphics', 'fullscreen', win.fullscreen)
        Config.write()
Example #54
0
def OrcaConfigParser_On_Setting_Change(config: kivyConfig, section: str,
                                       key: str, value: str) -> None:

    uSection: str = section
    uKey: str = key
    uValue: str = value

    # uValue = ToUnicode(value)

    if uSection == "ORCA":
        if uKey == u'button_clear_atlas':
            ClearAtlas()
        elif uKey == u"button_notification":
            uNotification = uValue.split("_")[-1]
            Globals.oNotifications.SendNotification(
                uNotification=uNotification, **{
                    "key": uKey,
                    "value": uValue
                })
        elif uKey == u'button_discover_rediscover':
            if uValue == u'button_discover_rediscover':
                Globals.oInterFaces.DiscoverAll()
            else:
                Globals.oInterFaces.DiscoverAll(bForce=True)
        elif uKey == u'button_discover_results':
            from ORCA.utils.Discover import cDiscover_List
            Globals.oApp.oDiscoverList = cDiscover_List()
            Globals.oApp.oDiscoverList.ShowList()
        elif uKey == u'button_installed_reps':
            Globals.oDownLoadSettings.LoadDirect(uDirect=uValue, bForce=True)
        elif uKey == u'button_show_installationhint':
            Var_DeleteCookie(uVarName='SHOWINSTALLATIONHINT',
                             uPrefix=Globals.uDefinitionName)
            Globals.oTheScreen.AddActionToQueue(
                aActions=[{
                    'string': 'call',
                    'actionname': 'Fkt ShowInstallationHint'
                }])
        elif uKey == u'button_show_powerstati':
            Globals.oTheScreen.AddActionShowPageToQueue(
                uPageName=u'Page_PowerStati')
        elif uKey == u'button_updateallreps':
            Globals.oDownLoadSettings.UpdateAllInstalledRepositories(
                bForce=True)
        elif uKey == u'showborders':
            Globals.bShowBorders = not Globals.bShowBorders
            Globals.oTheScreen.AddActionToQueue(
                aActions=[{
                    'string': 'updatewidget *@*'
                }])
        elif uKey == u'language':
            # Changes the languages, reloads all strings and reloads the settings dialog
            Globals.uLanguage = uValue
            Globals.oApp.InitPathes()
            Globals.oNotifications.SendNotification(
                uNotification="on_language_change")
        elif uKey == u'locales':
            Globals.uLocalesName = uValue
            Globals.oTheScreen.LoadLocales()
        elif uKey == u'startrepeatdelay':
            Globals.fStartRepeatDelay = float(uValue)
        elif uKey == u'longpresstime':
            Globals.fLongPressTime = float(uValue)
        elif uKey == u'contrepeatdelay':
            Globals.fContRepeatDelay = float(uValue)
        elif uKey == u'clockwithseconds':
            Globals.bClockWithSeconds = (uValue == '1')
        elif uKey == u'longdate':
            Globals.bLongDate = (uValue == '1')
        elif uKey == u'longday':
            Globals.bLongDay = (uValue == '1')
        elif uKey == u'longmonth':
            Globals.bLongMonth = (uValue == '1')
        elif uKey == u'checkfornetwork':
            Globals.bConfigCheckForNetwork = (uValue == '1')
        elif uKey == u'vibrate':
            Globals.bVibrate = (uValue == '1')
        elif uKey == u'button_configureinterface':
            uButton, Globals.oTheScreen.uInterFaceToConfig, Globals.oTheScreen.uConfigToConfig = uValue.split(
                ':')
            Globals.oTheScreen.AddActionShowPageToQueue(
                uPageName=u'Page_InterfaceSettings')
        elif uKey == u'button_configurescripts':
            uAction: str
            uScriptName: str
            uAction, uScriptName = uValue.split(':')
            if uAction == "button_configure":
                Globals.oTheScreen.uScriptToConfig = uScriptName
                Globals.oTheScreen.AddActionShowPageToQueue(
                    uPageName=u'Page_ScriptSettings')
            elif uAction == "button_run":
                kwargs = {"caller": "settings"}
                Globals.oScripts.RunScript(uScriptName, **kwargs)

        elif uKey == u'definition':
            ShowQuestionPopUp(
                uTitle='$lvar(599)',
                uMessage='$lvar(5026)',
                fktYes=Globals.oApp.on_config_change_change_definition,
                uStringYes='$lvar(5001)',
                uStringNo='$lvar(5002)')
        elif uKey == u'skin':
            Globals.oApp.ReStart()
        elif uKey == u'rootpath':
            if not Globals.bInit:
                Globals.oApp.close_settings()
                Globals.oApp._app_settings = None
                kivyConfig.write()
                Clock.schedule_once(Globals.oApp.Init_ReadConfig, 0)
            else:
                ShowMessagePopUp(uMessage=u'$lvar(5011)')
        elif uKey == u'sound_muteall':
            Globals.oSound.bMute = ToBool(uValue)
        elif uKey.startswith(u'soundvolume_'):
            uSoundName = uKey[12:]
            Globals.oSound.SetSoundVolume(uSoundName=uSoundName,
                                          iValue=ToInt(uValue))
            Globals.oSound.PlaySound(uSoundName=uSoundName)
        elif uKey == u'button_changedefinitionsetting':
            Globals.uDefinitionToConfigure = uValue[7:]
            Globals.oTheScreen.AddActionShowPageToQueue(
                uPageName=u'Page_DefinitionSettings')
            if uKey in Globals.oDefinitions.aDefinitionSettingVars:
                SetVar(uVarName=uKey, oVarValue=uValue)
        else:
            pass
Example #55
0
 def set_mode(self, mode):
     """ Sets the keyboard mode to the one specified """
     Config.set("kivy", "keyboard_mode", mode.replace("'", ""))
     Config.write()
     self.center_label.text = "Please restart the application for this\n" \
         "setting to take effect."
Example #56
0
def GUI_define_sizes():
    Config.set('graphics', 'width', '800')
    Config.set('graphics', 'height', '480')
    Config.set('graphics', 'borderless', 'True')
    Config.write()
    pass
Example #57
0
import kivy
from kivy.config import Config
from kivy.app import App
from kivy.lang import Builder

# Builder.load_file('data/style.kv')


class VdiClientApp(App):
  def do_login(self, username, password):
    print 'hello! %s login with password %s.' % (username.text, password.text)


if __name__ == '__main__':
  Config.set('graphics', 'fullscreen', 'auto')
  Config.write()
  VdiClientApp().run()
Example #58
0
    def __init__(self, **kwargs):
        # make sure we aren't overriding any important functionality
        super(Widgets, self).__init__(**kwargs)
        Config.set('graphics', 'width', '1800')
        Config.set('graphics', 'height', '900')
        Config.write()

        root = Widget()
        print "root.width: %f" % root.width
        print "root.height: %f" % root.height
        self.add_widget(
            AsyncImage(source=str(Global.image_url),
                       pos=(-root.width * 6, root.height * 3.25)))
        self.add_widget(
            Label(text='@' + str(Global.screen_name),
                  pos=(-root.width * 6, root.height * 2)))
        self.add_widget(
            Label(text="location: " + str(Global.location),
                  pos=(-root.width * 6, root.height * 1.3)))
        self.add_widget(
            Label(text="verified: " + str(Global.verified),
                  pos=(-root.width * 6, root.height)))
        self.add_widget(
            Label(text="on Twitter since: " + str(Global.created_at),
                  pos=(-root.width * 6, root.height * 0.7)))
        self.add_widget(
            Label(text="description:\n" + str(Global.description),
                  pos=(-root.width * 6, root.height * 0.3)))
        self.add_widget(
            Label(text=str(Global.tweets) + "\ntweets",
                  pos=(-root.width * 3, root.height * 3.5)))
        self.add_widget(
            Label(text=str(Global.followers) + "\nfollowers",
                  pos=(-root.width, root.height * 3.5)))
        self.add_widget(
            Label(text=str(Global.following) + "\nfollowing",
                  pos=(root.width, root.height * 3.5)))
        self.add_widget(
            Label(text=str(Global.average_tweet_time) + "\naverage tweet time",
                  pos=(root.width * 5, root.height * 4)))
        self.add_widget(
            Label(text=str(Global.average_tweet_retweets) +
                  "\naverage retweets in tweets",
                  pos=(root.width * 5, root.height * 3)))
        self.add_widget(
            Label(text=str(Global.average_tweet_favorites) +
                  "\naverage favorites in tweets",
                  pos=(root.width * 5, root.height * 2)))
        self.add_widget(
            Label(text=str(Global.followback_percentage),
                  pos=(-root.width * .4, root.height * 1.5)))
        self.add_widget(
            Image(source=str(Global.wordcloud_tweets_image),
                  pos=(root.width * 0.35, root.height),
                  size_hint_y=None,
                  height=350))
        if (Global.hashtags_found > 0):
            self.add_widget(
                Image(source=str(Global.wordcloud_hashtags_image),
                      pos=(-root.width * 6, root.height),
                      size_hint_y=None,
                      height=350))
        self.add_widget(
            Label(text="most tweets per day: " +
                  str(Global.most_tweets_per_day) + " on " +
                  str(Global.most_tweets_day),
                  pos=(-root.width * .6, root.height * 0.6)))
        self.add_widget(
            Label(text="5 most recent tweets: ",
                  pos=(-root.width * .6, -root.height * 3.5)))
        carousel = Carousel(direction='right')
        for i in range(5):
            tweet_layout = FloatLayout()
            tweet_layout.add_widget(
                Label(text="#" + str(i + 1) + ":\n" +
                      Global.five_latest_tweets[i],
                      pos=(-root.width * .6, -root.height * 3.8)))
            tweet_layout.add_widget(
                Image(source=str('img/date.png'),
                      pos=(-root.width * 1.8, 0),
                      size_hint_y=None,
                      height=35))
            tweet_layout.add_widget(
                Image(source=str('img/retweets.png'),
                      pos=(-root.width * 0.5, 0),
                      size_hint_y=None,
                      height=35))
            tweet_layout.add_widget(
                Image(source=str('img/likes.png'),
                      pos=(root.width * 0.2, 0),
                      size_hint_y=None,
                      height=35))
            tweet_layout.add_widget(
                Label(text=Global.five_latest_dates[i],
                      pos=(-root.width * 1.2, -root.height * 4.32)))
            tweet_layout.add_widget(
                Label(text=Global.five_latest_retweets[i],
                      pos=(-root.width * 0.2, -root.height * 4.32)))
            tweet_layout.add_widget(
                Label(text=Global.five_latest_likes[i],
                      pos=(root.width * 0.5, -root.height * 4.32)))
            carousel.add_widget(tweet_layout)
        carousel.disabled = True
        carousel.opacity = 6
        carousel.loop = True
        self.add_widget(carousel)
        timeline.create()
        self.add_widget(
            Image(source='png/' + str(Global.screen_name) + '_gantt.png',
                  pos=(root.width * 6.35, root.height * 1.5),
                  size_hint_y=None,
                  height=380))
        if (Global.fishy_followers != 0):
            self.add_widget(
                Image(source='img/warning.png',
                      pos=(-root.width * 2, root.height * 6.5),
                      size_hint_y=None,
                      height=35))
            self.add_widget(
                Label(text=str(Global.fishy_followers) +
                      " suspicious followers found",
                      pos=(-root.width * 0.8, root.height * 2.15)))

        def printit():
            if (self.run_carousel):
                threading.Timer(5.0, printit).start()
                # print "RUNNING THREAD!"
                carousel.load_next(mode='next')

        printit()
Example #59
0
 def set_mode(self, mode):
     """ Sets the keyboard mode to the one specified """
     Config.set("kivy", "keyboard_mode", mode.replace("'", ""))
     Config.write()
     self.center_label.text = "Please restart the application for this\n" \
         "setting to take effect."
Example #60
0
def save_setting(key, value, section='General'):
    Config.read(SETTINGS_FILE)
    Config.set(section, key, value)
    Config.write()