Code Duplication    Length = 11-11 lines in 2 locations

client/osci/client.py 1 location

@@ 181-191 (lines=11) @@
178
        obj = db[objID]
179
        if hasattr(obj, "combatCounter"):
180
            obj.combatCounter = 0
181
        if not hasattr(obj, 'type'):
182
            del db[objID]
183
        elif obj.type == Const.T_FLEET:
184
            del db[objID]
185
        elif hasattr(obj, 'owner') and obj.owner == db.playerID \
186
            and objID != db.playerID:
187
            # delete player's objects
188
            del db[objID]
189
        else:
190
            if hasattr(obj, "scanPwr"): obj.scanPwr = 0
191
            if hasattr(obj, "scannerPwr"): obj.scannerPwr = 0
192
    # update player
193
    current += 1
194
    callbackObj.onUpdateProgress(current, max, _("Downloading player data..."))

client-ai/ai_client.py 1 location

@@ 107-117 (lines=11) @@
104
        obj = db[objID]
105
        if hasattr(obj, "combatCounter"):
106
            obj.combatCounter = 0
107
        if not hasattr(obj, 'type'):
108
            del db[objID]
109
        elif obj.type == Const.T_FLEET:
110
            del db[objID]
111
        elif hasattr(obj, 'owner') and obj.owner == db.playerID \
112
            and objID != db.playerID:
113
            # delete player's objects
114
            del db[objID]
115
        else:
116
            if hasattr(obj, "scanPwr"): obj.scanPwr = 0
117
            if hasattr(obj, "scannerPwr"): obj.scannerPwr = 0
118
    # update player
119
    db[db.playerID] = get(db.playerID)
120
    player = db[db.playerID]