当前位置: 首页>>代码示例>>Python>>正文


Python JsonStore.count方法代码示例

本文整理汇总了Python中kivy.storage.jsonstore.JsonStore.count方法的典型用法代码示例。如果您正苦于以下问题:Python JsonStore.count方法的具体用法?Python JsonStore.count怎么用?Python JsonStore.count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kivy.storage.jsonstore.JsonStore的用法示例。


在下文中一共展示了JsonStore.count方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: addStory

# 需要导入模块: from kivy.storage.jsonstore import JsonStore [as 别名]
# 或者: from kivy.storage.jsonstore.JsonStore import count [as 别名]
class addStory(object):
    '''
    This class is used for adding story to the game

    Syntax for the story is a key based dictionary, these keys are hexadacimal numbers
    that will be used to track progress. Starting point is 1, so if scenario 1 had 3
    possible options then there would be 11, 12, and 13. If 13 had 2 options then it would
    be 131, and 132. This will continue until there is a string of 16 characters

    basic syntax: {key
    '''

    def __init__(self):
        self.File = raw_input("Which story would you like to edit?\n\n").lower()
        self.data = JsonStore(self.File + '.json')
        self.start = 1 #default start code
        if self.data.count(): #If file has been started
            print '\nLooking for where you left off...\n'
            keys = self.data.keys()
            leftOff = int(keys[len(keys) - 1])
            print ('It seems like you left off at event number'
                    ' %d, so let\'s move on to number %d.'
                    % (leftOff, leftOff + 1)
                    )
            self.start = leftOff
        self.addToDBLoop(self.start)

    def addToDBLoop(self, number):
        event = raw_input('What is event number %d?\n' % number).lower()
        optionsStr = raw_input(('What are the available options for player?\n'
            'If none just type \'none\'.\n')).lower().split()
        c = 0
        options = {}
        for o in optionsStr:
            c += 1
            options[o] = str(number) + str(c)
        self.data.put(str(number), event = event, options = options)
开发者ID:Autzmosis,项目名称:dungeonGame,代码行数:39,代码来源:addStory.py

示例2: print

# 需要导入模块: from kivy.storage.jsonstore import JsonStore [as 别名]
# 或者: from kivy.storage.jsonstore.JsonStore import count [as 别名]
charIndustry = 'char/IndustryJobs.xml.aspx?keyID=%s&vCode=%s&characterID=%s'


# Defaults that will be replaced by the API returned data.
# ['Server Online', Players, Cache Expire]
# serverStatus = ['', '0', serverTime]

# Global variables to store the cacheUtil time and table rows.
jobsCachedUntil = serverTime
starbaseCachedUntil = serverTime


# This is where we are storing our API keys.
pilotRows = []

if pilotCache.count() > 0:
    print('Character Data Already Exists: %s Entries' % (len(pilotCache)))
    for key in pilotCache:
        print(key)  # Using characterID as key
        print(pilotCache.get(key)['characterName'])
        # keyID, vCode, characterID, characterName, corporationID, corporationName, keyType, keyExpires, skills, isActive
        pilotRows.append(Character(pilotCache.get(key)['keyID'], pilotCache.get(key)['vCode'],
                                   pilotCache.get(key)['characterID'], pilotCache.get(key)['characterName'],
                                   pilotCache.get(key)['corporationID'], pilotCache.get(key)['corporationName'],
                                   pilotCache.get(key)['keyType'], pilotCache.get(key)['keyExpires'],
                                   pilotCache.get(key)['skills'], pilotCache.get(key)['isActive']))
else:
    # No Pilot data.
    print('No Pilot data.')

开发者ID:EluOne,项目名称:Nesi,代码行数:31,代码来源:config.py


注:本文中的kivy.storage.jsonstore.JsonStore.count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。