Changeset 341 for trunk/game/scripts


Ignore:
Timestamp:
10/23/09 18:18:29 (10 years ago)
Author:
eliedebrauwer
Message:

Ticket #128. Fix by octavio, PEP-8 code cleanup. (I plea guilty for the semi-colons). fixes[s:trac, t:128]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/engine.py

    r340 r341  
    5252           @param filename: the name of the file to write to 
    5353           @return: None""" 
    54         fname = '/'.join([path,filename]) 
     54        fname = '/'.join([path, filename]) 
    5555        try: 
    5656            f = open(fname, 'w') 
     
    6161        # can't pickle SwigPyObjects 
    6262        behaviours = {} 
    63         behaviour_player = self.game_state.PC.behaviour; 
    64         self.game_state.PC.behaviour = None; 
     63        behaviour_player = self.game_state.PC.behaviour 
     64        self.game_state.PC.behaviour = None 
    6565         
    6666        # Backup the behaviours  
     
    7070                if npc.trueAttr("NPC"): 
    7171                    behaviours[map_id][object_id] = npc.behaviour 
    72                     npc.behaviour = None; 
     72                    npc.behaviour = None 
    7373         
    7474        # Pickle it  
     
    7878        # Restore behaviours 
    7979        for map_id in behaviours: 
    80             for (object_id,behaviour) in behaviours[map_id].items(): 
     80            for (object_id, behaviour) in behaviours[map_id].items(): 
    8181                self.game_state.objects[map_id][object_id].behaviour = \ 
    8282                    behaviours[map_id][object_id] 
     
    163163        if ref is None: 
    164164            # no, add it to the game state 
    165             self.game_state.objects[self.game_state.current_map_name][obj.ID] = obj 
     165            self.game_state.objects[self.game_state.current_map_name][obj.ID] \ 
     166                                                                          = obj 
    166167        else: 
    167168            # yes, use the current game state data 
     
    184185           @rtype: boolean 
    185186           @return: Status of result (True/False)""" 
    186         for i in self.game_state.getObjectsFromMap(self.game_state.current_map_name): 
     187        for i in \ 
     188           self.game_state.getObjectsFromMap(self.game_state.current_map_name): 
    187189            if (i.ID == ident): 
    188190                # we found a match 
     
    197199           @rtype: list 
    198200           @return: List of text and callbacks""" 
    199         actions=[] 
     201        actions = [] 
    200202        # note: ALWAYS check NPC's first! 
    201203        obj = self.game_state.getObjectById(obj_id, \ 
     
    271273        self.game_state.PC.start() 
    272274 
    273     def handleMouseClick(self,position): 
     275    def handleMouseClick(self, position): 
    274276        """Code called when user left clicks the screen. 
    275277           @type position: fife.ScreenPoint 
Note: See TracChangeset for help on using the changeset viewer.