当前位置: 首页>>代码示例>>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;未经允许,请勿转载。