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


Python objects.Objects類代碼示例

本文整理匯總了Python中objects.Objects的典型用法代碼示例。如果您正苦於以下問題:Python Objects類的具體用法?Python Objects怎麽用?Python Objects使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: on_enter

 def on_enter(self):
     super(MainMenu, self).on_enter()
     constants.MUSIC = True
     menu_player.set_volume(2)
     if self.game_started:
         Objects.reset_game()
         self.game_started = False
開發者ID:david-abel,項目名稱:noteworks,代碼行數:7,代碼來源:game.py

示例2: get_user_info

 def get_user_info(user_extension):
     result = dict()
     result = Objects.get_object_info(user_extension)
     temp = Objects.get_object_info(user_extension.user)
     temp["user_id"] = temp["id"]
     result["userextension_id"] = result["id"]
     result.update(temp)
     return result
開發者ID:appleface2050,項目名稱:WorkCode_Bakup,代碼行數:8,代碼來源:users.py

示例3: update

 def update(publish, publish_dict):
     try:
         for (key, value) in publish_dict.items():
             Objects.set_value(publish, key, value)
         publish.save()
         return publish
     except Exception as ex:
         Logs.print_current_function_name_and_line_number(ex)
         return None
開發者ID:appleface2050,項目名稱:WorkCode_Bakup,代碼行數:9,代碼來源:publishes.py

示例4: static_update

 def static_update(address, address_dict):
     try:
         for (key, value) in address_dict.items():
             Objects.set_value(address, key, value)
         address.save()
         return address
     except Exception as ex:
         Logs.print_current_function_name_and_line_number(ex)
         return Address.get_none()
開發者ID:appleface2050,項目名稱:WorkCode_Bakup,代碼行數:9,代碼來源:addresses.py

示例5: update_shop

 def update_shop(shop, shop_dict):
     try:
         for (key, value) in shop_dict.items():
             Objects.set_value(shop, key, value)
         shop.save()
         return shop
     except Exception as ex:
         Logs.print_current_function_name_and_line_number(ex)
         return Shops.get_none()
開發者ID:appleface2050,項目名稱:WorkCode_Bakup,代碼行數:9,代碼來源:shops.py

示例6: on_win

 def on_win(self):
     Objects.reset_game()
     server = Objects.get_server(self.levelName)
     server.curLevel = self.level+1
     utils.play_sound("Enter.wav")
     game = Scene(server.map, server)
     game.add(ImageLayer(os.path.join("images", "backgrounds", "notebook-paper.png")), z=BACKGROUND_Z)
     director.push(game)
     menu_player.stop()
     self.game_started = True
開發者ID:david-abel,項目名稱:noteworks,代碼行數:10,代碼來源:game.py

示例7: update_user

    def update_user(user, user_extension_dict, user_dict):
        if user_extension_dict:
            try:
                ue = user.userextension
                for (key, value) in user_extension_dict.items():
                    Objects.set_value(ue, key, value)
                ue.save()
            except Exception as ex:
                Logs.print_current_function_name_and_line_number(ex)
                return Users.get_none()
        if user_dict:
            for (key, value) in user_dict.items():
                Objects.set_value(user, key, value)
            user.save()

        return user
開發者ID:appleface2050,項目名稱:WorkCode_Bakup,代碼行數:16,代碼來源:users.py

示例8: server_on_attack

 def server_on_attack(self,tpid,tuid,val):
     # print "server_on_attack", tpid,tuid,val
     client = Objects.get_client()
     p = client.players[tpid]
     if tuid in p.units.keys():
         p.units[tuid].client_on_attack(val)
     return {}
開發者ID:david-abel,項目名稱:noteworks,代碼行數:7,代碼來源:client.py

示例9: get_info

 def get_info(red_envelope):
     try:
         result = Objects.get_object_info(red_envelope)
         return result
     except Exception as ex:
         Logs.print_current_function_name_and_line_number(ex)
         return dict()
開發者ID:appleface2050,項目名稱:WorkCode_Bakup,代碼行數:7,代碼來源:redenvelopes.py

示例10: server_build_unit

 def server_build_unit(self, pid, tid, vid, uid,buid):        
     # print "building unit", pid, tid, vid, uid
     client = Objects.get_client()
     player = client.players[pid]
     if uid not in player.underConstruction.keys():
         client.build_unit(tid, player, vid=vid, uid=uid)
     return {}
開發者ID:david-abel,項目名稱:noteworks,代碼行數:7,代碼來源:client.py

示例11: get_big_categories

    def get_big_categories():
        category_list = list()
        categories = ShopCategory.objects.filter(parent_id=1)
        for c in categories:
            temp = Objects.get_object_info(c)
            category_list.append(temp)

        return category_list
開發者ID:appleface2050,項目名稱:WorkCode_Bakup,代碼行數:8,代碼來源:shop_categories.py

示例12: server_start_game

 def server_start_game(self):
     '''
     The client stub that gets called when the server starts the game
     '''
     client = Objects.get_client()
     client._init_players()
     client.start_game()
     return {}
開發者ID:david-abel,項目名稱:noteworks,代碼行數:8,代碼來源:client.py

示例13: main

def main():
    while 1:
        try:
            queue_id, decoded_json = get_data()
        except:
            time.sleep(0.5)
            continue
        try:
            print "AAAA"
            objects = Objects(queue_id, decoded_json)
            results = objects.calculate()
        except:
            errorMessage = sys.exc_info()
            print('Error Type: %s' % errorMessage[0])
            print('Error Message: %s' % errorMessage[1])
            write_error(queue_id, errorMessage)
            continue
        put_data(queue_id, results)
開發者ID:mil-tokyo,項目名稱:jphacks,代碼行數:18,代碼來源:put_data.py

示例14: client_build_unit

 def client_build_unit(self,pid,tid,vid,uid,buid):
     # print "client",pid, "built unit", tid, "on", vid
     server = Objects.get_controller()
     p = server.players[pid]
     if buid != -1:
         server.build_unit(tid,p,vid=vid,builder=p.units[buid])
     else:
         server.build_unit(tid,p,vid=vid)
     return {}
開發者ID:david-abel,項目名稱:noteworks,代碼行數:9,代碼來源:server.py

示例15: join_game

 def join_game(self):
     constants.MULTIPLAYER = True
     utils.play_sound("Enter.wav")
     c = Objects.get_client()
     c.start_server()  # start client server
     connection = c.server_connect()  # connect to game server
     if not connection:
         c.stop_server()
     menu_player.stop()
     self.game_started = True
開發者ID:david-abel,項目名稱:noteworks,代碼行數:10,代碼來源:game.py


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