當前位置: 首頁>>代碼示例>>Python>>正文


Python jsonstore.JsonStore方法代碼示例

本文整理匯總了Python中kivy.storage.jsonstore.JsonStore方法的典型用法代碼示例。如果您正苦於以下問題:Python jsonstore.JsonStore方法的具體用法?Python jsonstore.JsonStore怎麽用?Python jsonstore.JsonStore使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在kivy.storage.jsonstore的用法示例。


在下文中一共展示了jsonstore.JsonStore方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_store

# 需要導入模塊: from kivy.storage import jsonstore [as 別名]
# 或者: from kivy.storage.jsonstore import JsonStore [as 別名]
def get_store(cls):
        """
        Returns the full user Store object instance.
        """
        store_path = cls.get_store_path()
        store = JsonStore(store_path)
        return store 
開發者ID:AndreMiras,項目名稱:PyWallet,代碼行數:9,代碼來源:main.py

示例2: init_settings

# 需要導入模塊: from kivy.storage import jsonstore [as 別名]
# 或者: from kivy.storage.jsonstore import JsonStore [as 別名]
def init_settings(self):
        #app = App.get_running_app()
        from os.path import join as os_path_join
        self.store = JsonStore(os_path_join(self.user_data_dir, 'storage'))
                
        # gui persistent settings
        try:
            self.example_property = self.store.get('example_property_section')['example_property']
             #Logger.info('StorageMdl: found stored gui_multi: {}'.format(self.gui_multi))
        except KeyError:
            self.example_property = 2.0
            #Logger.info('StorageMdl: failed to find gui_multi, setting default') 
開發者ID:suchyDev,項目名稱:Kivy-Dynamic-Screens-Template,代碼行數:14,代碼來源:generic.py

示例3: build

# 需要導入模塊: from kivy.storage import jsonstore [as 別名]
# 或者: from kivy.storage.jsonstore import JsonStore [as 別名]
def build(self):
        self.store = JsonStore(os.path.join(self.user_data_dir, 'ninetyperten.json'))
        sm = NinetyPerTenScreenManager(self.store)
        main_screen = MainScreen(
            name=MAIN_SCREEN_NAME,
        )
        hist_screen = HistoryScreen(
            name=HISTORY_SCREEN_NAME
        )
        sm.add_widget(main_screen)
        sm.add_widget(hist_screen)
        return sm 
開發者ID:arruda,項目名稱:ninety_per_ten,代碼行數:14,代碼來源:main.py

示例4: store_data

# 需要導入模塊: from kivy.storage import jsonstore [as 別名]
# 或者: from kivy.storage.jsonstore import JsonStore [as 別名]
def store_data(self, token):
        """
        Stores the 'token' in json format.
        """
        store = JsonStore('data.json')
        store.put('creds', token=token)
        show_cloudcb(self.manager, token) 
開發者ID:krsoninikhil,項目名稱:cloud-clipboard,代碼行數:9,代碼來源:main.py

示例5: get_data

# 需要導入模塊: from kivy.storage import jsonstore [as 別名]
# 或者: from kivy.storage.jsonstore import JsonStore [as 別名]
def get_data(self, key):
        store = JsonStore('data.json')
        if store.exists(key):
            return store.get(key)['token']
        return None 
開發者ID:krsoninikhil,項目名稱:cloud-clipboard,代碼行數:7,代碼來源:main.py

示例6: __init__

# 需要導入模塊: from kivy.storage import jsonstore [as 別名]
# 或者: from kivy.storage.jsonstore import JsonStore [as 別名]
def __init__(self):
        self._access_lock = RLock()
        self.modules = {}

        with self._access_lock:
            self.store = JsonStore('persist.json') 
開發者ID:CylanceSPEAR,項目名稱:mitmcanary,代碼行數:8,代碼來源:persistence.py

示例7: __init__

# 需要導入模塊: from kivy.storage import jsonstore [as 別名]
# 或者: from kivy.storage.jsonstore import JsonStore [as 別名]
def __init__(self, data_dir, name, do_date=False, do_hour=False, **kwargs):
        super(DBInterface, self).__init__(**kwargs)
        
        self.ensure_dir(data_dir)
        if do_date:
            if do_hour:
                date = self.convert_time_to_json_ymdh(self.get_time())
            else:
                date = self.convert_time_to_json_ymd(self.get_time())
            json_name = data_dir + name + '-' + date + '.json'
            reset_json_name = (
                data_dir + name + '-' + date + '-reset_timers.json')
        else:
            json_name = data_dir + name + '.json'
            reset_json_name = data_dir + name + '-reset_timers.json'
        self.data = data = JsonStore(json_name)
        self.reset_timers = reset_timers = JsonStore(reset_json_name)
        self.sync = Clock.create_trigger(self.trigger_sync)
        self.check_reset(0.)
        Clock.schedule_interval(self.check_reset, 60.) 
開發者ID:Kovak,項目名稱:KivyNBT,代碼行數:22,代碼來源:dbinterface.py

示例8: reloadSchedule

# 需要導入模塊: from kivy.storage import jsonstore [as 別名]
# 或者: from kivy.storage.jsonstore import JsonStore [as 別名]
def reloadSchedule():
	with scheduleLock:
		schedule.clear()

		activeSched = None

		with thermostatLock:
			thermoSched = JsonStore( "thermostat_schedule.json" )
			if holdControl != "down" :
				if heatControl.state == "down":
					activeSched = thermoSched[ "heat" ]  
					log( LOG_LEVEL_INFO, CHILD_DEVICE_SCHEDULER, MSG_SUBTYPE_CUSTOM + "/load", "heat" )
			if useTestSchedule: 
				activeSched = getTestSchedule()
				log( LOG_LEVEL_INFO, CHILD_DEVICE_SCHEDULER, MSG_SUBTYPE_CUSTOM + "/load", "test" )
				print "Using Test Schedule!!!"
	
		if activeSched != None:
			for day, entries in activeSched.iteritems():
				for i, entry in enumerate( entries ):
					getattr( schedule.every(), day ).at( entry[ 0 ] ).do( setScheduledTemp, entry[ 1 ] )
					log( LOG_LEVEL_DEBUG, CHILD_DEVICE_SCHEDULER, MSG_SUBTYPE_TEXT, "Set " + day + ", at: " + entry[ 0 ] + " = " + str( entry[ 1 ] ) + scaleUnits )


##############################################################################
#                                                                            #
#       Web Server Interface                                                 #
#                                                                            #
##############################################################################

##############################################################################
#      encoding: UTF-8                                                       #
# Form based authentication for CherryPy. Requires the                       #
# Session tool to be loaded.                                                 #
############################################################################## 
開發者ID:jpnos26,項目名稱:thermostat_ita,代碼行數:37,代碼來源:thermostat.py

示例9: reloadSchedule

# 需要導入模塊: from kivy.storage import jsonstore [as 別名]
# 或者: from kivy.storage.jsonstore import JsonStore [as 別名]
def reloadSchedule():
	with scheduleLock:
		schedule.clear()

		activeSched = None

		with thermostatLock:
			thermoSched = JsonStore( "thermostat_schedule.json" )
	
			if holdControl.state != "down":
				if heatControl.state == "down":
					activeSched = thermoSched[ "heat" ]  
					log( LOG_LEVEL_INFO, CHILD_DEVICE_SCHEDULER, MSG_SUBTYPE_CUSTOM + "/load", "heat" )
				elif coolControl.state == "down":
					activeSched = thermoSched[ "cool" ]  
					log( LOG_LEVEL_INFO, CHILD_DEVICE_SCHEDULER, MSG_SUBTYPE_CUSTOM + "/load", "cool" )

				if useTestSchedule: 
					activeSched = getTestSchedule()
					log( LOG_LEVEL_INFO, CHILD_DEVICE_SCHEDULER, MSG_SUBTYPE_CUSTOM + "/load", "test" )
					print "Using Test Schedule!!!"
	
		if activeSched != None:
			for day, entries in activeSched.iteritems():
				for i, entry in enumerate( entries ):
					getattr( schedule.every(), day ).at( entry[ 0 ] ).do( setScheduledTemp, entry[ 1 ] )
					log( LOG_LEVEL_DEBUG, CHILD_DEVICE_SCHEDULER, MSG_SUBTYPE_TEXT, "Set " + day + ", at: " + entry[ 0 ] + " = " + str( entry[ 1 ] ) + scaleUnits )


##############################################################################
#                                                                            #
#       Web Server Interface                                                 #
#                                                                            #
############################################################################## 
開發者ID:scottpav,項目名稱:RaspberryPiThermostat,代碼行數:36,代碼來源:thermostat.py


注:本文中的kivy.storage.jsonstore.JsonStore方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。