Skip to content

Commit f0a73a9

Browse files
committed
PEP8 fixes.
Alphabetized items in CMakeLists.txt
1 parent d49a2dc commit f0a73a9

File tree

16 files changed

+150
-133
lines changed

16 files changed

+150
-133
lines changed

addons/source-python/packages/source-python/cvars/flags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
# =============================================================================
4141
class ConVarFlags(object):
4242
'''ConVar's flags wrapper enumerator.
43-
43+
4444
TODO: Inherit of "enum.IntEnum" once we have upgraded to Python 3.4+.
4545
'''
4646
NONE = FCVAR_NONE

addons/source-python/packages/source-python/engines/sound.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
# =============================================================================
4343
class Attenuations(object):
4444
'''Attenuation values wrapper enumerator.
45-
45+
4646
TODO: Inherit of "enum.IntEnum" once we have upgraded to Python 3.4+.
4747
'''
4848
NONE = ATTN_NONE
@@ -56,7 +56,7 @@ class Attenuations(object):
5656

5757
class PitchTypes(object):
5858
'''Pitch values wrapper enumerator.
59-
59+
6060
TODO: Inherit of "enum.IntEnum" once we have upgraded to Python 3.4+.
6161
'''
6262
NORMAL = PITCH_NORM

addons/source-python/packages/source-python/engines/trace.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
# =============================================================================
114114
class DisplacementFlags(object):
115115
'''Displacement flags wrapper enumerator.
116-
116+
117117
TODO: Inherit of "enum.IntEnum" once we have upgraded to Python 3.4+.
118118
'''
119119
SURFACE = DISPSURF_FLAG_SURFACE
@@ -125,7 +125,7 @@ class DisplacementFlags(object):
125125

126126
class ContentFlags(object):
127127
'''Content flags wrapper enumerator.
128-
128+
129129
TODO: Inherit of "enum.IntEnum" once we have upgraded to Python 3.4+.
130130
'''
131131
EMPTY = CONTENTS_EMPTY
@@ -137,7 +137,7 @@ class ContentFlags(object):
137137
WATER = CONTENTS_WATER
138138
BLOCKLOS = CONTENTS_BLOCKLOS
139139
OPAQUE = CONTENTS_OPAQUE
140-
LAST_VISIBLE= LAST_VISIBLE_CONTENTS
140+
LAST_VISIBLE = LAST_VISIBLE_CONTENTS
141141
ALL_VISIBLE = ALL_VISIBLE_CONTENTS
142142
TESTFOGVOLUME = CONTENTS_TESTFOGVOLUME
143143
UNUSED = CONTENTS_UNUSED
@@ -165,7 +165,7 @@ class ContentFlags(object):
165165

166166
class ContentMasks(object):
167167
'''Content masks wrapper enumerator.
168-
168+
169169
TODO: Inherit of "enum.IntEnum" once we have upgraded to Python 3.4+.
170170
'''
171171
ALL = MASK_ALL
@@ -192,7 +192,7 @@ class ContentMasks(object):
192192

193193
class SurfaceFlags(object):
194194
'''Surface flags wrapper enumerator.
195-
195+
196196
TODO: Inherit of "enum.IntEnum" once we have upgraded to Python 3.4+.
197197
'''
198198
LIGHT = SURF_LIGHT
@@ -210,4 +210,4 @@ class SurfaceFlags(object):
210210
NOSHADOWS = SURF_NOSHADOWS
211211
NODECALS = SURF_NODECALS
212212
NOCHOP = SURF_NOCHOP
213-
HITBOX = SURF_HITBOX
213+
HITBOX = SURF_HITBOX

addons/source-python/packages/source-python/entities/datamaps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def __init__(self, desc):
286286
self.name = desc.name
287287
self.type = desc.type
288288
function = desc.input.make_function(
289-
Convention.THISCALL, self.arguments, Return.VOID)
289+
Convention.THISCALL, self.arguments, Return.VOID)
290290

291291
# Initialize the Function instance
292292
super(_BaseFunctions, self).__init__(function)

addons/source-python/packages/source-python/filters/players.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ def _player_is_on_team(self, PlayerInfo):
110110
'human', lambda playerinfo: playerinfo.is_player())
111111
_PlayerIterManagerInstance.register_filter(
112112
'alive', lambda playerinfo: not edict_from_playerinfo(
113-
playerinfo).get_prop_int('pl.deadflag'))
113+
playerinfo).get_prop_int('pl.deadflag'))
114114
_PlayerIterManagerInstance.register_filter(
115115
'dead', lambda playerinfo: edict_from_playerinfo(
116-
playerinfo).get_prop_int('pl.deadflag'))
116+
playerinfo).get_prop_int('pl.deadflag'))
117117

118118
# Loop through all teams in the game's team file
119119
for team in _game_teams['names']:
@@ -164,7 +164,7 @@ def _player_is_on_team(self, PlayerInfo):
164164
'info', lambda playerinfo: playerinfo)
165165
_PlayerIterManagerInstance.register_return_type(
166166
'player', lambda playerinfo: PlayerEntity(
167-
index_from_playerinfo(playerinfo)))
167+
index_from_playerinfo(playerinfo)))
168168
_PlayerIterManagerInstance.register_return_type(
169169
'name', lambda playerinfo: playerinfo.get_name())
170170
_PlayerIterManagerInstance.register_return_type(
@@ -185,6 +185,6 @@ def _player_is_on_team(self, PlayerInfo):
185185
'weapon', lambda playerinfo: playerinfo.get_weapon_name())
186186
_PlayerIterManagerInstance.register_return_type(
187187
'language', lambda playerinfo: EngineServer.get_client_convar_value(
188-
index_from_playerinfo(playerinfo), 'cl_language'))
188+
index_from_playerinfo(playerinfo), 'cl_language'))
189189
_PlayerIterManagerInstance.register_return_type(
190190
'team', lambda playerinfo: playerinfo.get_team_index())

addons/source-python/packages/source-python/listeners/tick/repeat.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,16 @@ def start(self, interval, limit):
7373
if self._status == TickRepeatStatus.RUNNING:
7474

7575
# Log the status
76-
TickRepeatLogger.log_info('TickRepeat.start - TickRepeatStatus.RUNNING')
76+
TickRepeatLogger.log_info(
77+
'TickRepeat.start - TickRepeatStatus.RUNNING')
7778

7879
# Do not start the repeat
7980
return
8081

8182
# Log starting the repeat
8283
TickRepeatLogger.log_info(
83-
'TickRepeat.start - !TickRepeatStatus.RUNNING - Starting TickRepeat')
84+
'TickRepeat.start - !TickRepeatStatus' +
85+
'.RUNNING - Starting TickRepeat')
8486

8587
# Set the status to running
8688
self._status = TickRepeatStatus.RUNNING
@@ -106,7 +108,8 @@ def stop(self):
106108
if self._status != TickRepeatStatus.RUNNING:
107109

108110
# Log the status
109-
TickRepeatLogger.log_info('TickRepeat.stop - !TickRepeatStatus.RUNNING')
111+
TickRepeatLogger.log_info(
112+
'TickRepeat.stop - !TickRepeatStatus.RUNNING')
110113

111114
# No need to stop it
112115
return
@@ -143,7 +146,8 @@ def pause(self):
143146
if self._status != TickRepeatStatus.RUNNING:
144147

145148
# Log the status
146-
TickRepeatLogger.log_info('TickRepeat.pause - !TickRepeatStatus.RUNNING')
149+
TickRepeatLogger.log_info(
150+
'TickRepeat.pause - !TickRepeatStatus.RUNNING')
147151

148152
# No need to pause
149153
return
@@ -171,14 +175,16 @@ def resume(self):
171175
if self._status != TickRepeatStatus.PAUSED:
172176

173177
# Log the status
174-
TickRepeatLogger.log_info('TickRepeat.resume - !TickRepeatStatus.PAUSED')
178+
TickRepeatLogger.log_info(
179+
'TickRepeat.resume - !TickRepeatStatus.PAUSED')
175180

176181
# Do not resume
177182
return
178183

179184
# Log resuming the repeat
180185
TickRepeatLogger.log_info(
181-
'TickRepeat.resume - TickRepeatStatus.PAUSED - Resuming TickRepeat')
186+
'TickRepeat.resume - TickRepeatStatus.' +
187+
'PAUSED - Resuming TickRepeat')
182188

183189
# Start the delay
184190
self._delay = TickDelays.delay(self._loop_time, self._execute)
@@ -247,7 +253,8 @@ def _execute(self):
247253

248254
# Log continuing the loop
249255
TickRepeatLogger.log_info(
250-
'TickRepeat._execute - Remaining - {0}'.format(self.remaining))
256+
'TickRepeat._execute - Remaining - {0}'.format(
257+
self.remaining))
251258

252259
# Call the delay again
253260
self._delay = TickDelays.delay(self._interval, self._execute)
@@ -256,7 +263,8 @@ def _execute(self):
256263
else:
257264

258265
# Log stopping the repeat
259-
TickRepeatLogger.log_info('TickRepeat._execute - Stopping the loop')
266+
TickRepeatLogger.log_info(
267+
'TickRepeat._execute - Stopping the loop')
260268

261269
# Set the status to stopped
262270
self._status = TickRepeatStatus.STOPPED

addons/source-python/packages/source-python/memory/manager.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(self, *args, wrap=False, auto_dealloc=True):
6262
if not isinstance(self._manager, TypeManager):
6363
raise ValueError(
6464
'Attribute _manager must be an instance of "TypeManager".')
65-
65+
6666
# This set will contain internally allocated pointers.
6767
self._allocated_pointers = set()
6868

@@ -426,19 +426,19 @@ def fset(ptr, value):
426426
else:
427427
# Go down to "instance level"
428428
instance_ptr = ptr.get_pointer(offset)
429-
429+
430430
# Is there no space allocated?
431431
if not instance_ptr:
432432
# Allocate space for the value
433433
instance_ptr = alloc(TYPE_SIZES[type_name.upper()])
434-
434+
435435
# Add the pointer to the set, so there will be a reference
436436
# until the instance gets deleted
437437
ptr._allocated_pointers.add(instance_ptr)
438-
438+
439439
# Set the pointer
440440
ptr.set_pointer(instance_ptr, offset)
441-
441+
442442
# Set the value
443443
getattr(instance_ptr, 'set_' + type_name)(value)
444444

addons/source-python/packages/source-python/messages/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
# ============================================================================
2424
# Loop trough all message classes
2525
for message_name, message_class in _UserMessages(SP_DATA_PATH.joinpath(
26-
'messages', 'usermessages.ini'), SP_DATA_PATH.joinpath('messages',
27-
'games', GAME_NAME + '.ini')).items():
26+
'messages', 'usermessages.ini'), SP_DATA_PATH.joinpath(
27+
'messages', 'games', GAME_NAME + '.ini')).items():
2828

2929
# Globalize the current message class
3030
globals()[message_name] = message_class

0 commit comments

Comments
 (0)