Skip to content

Commit d275182

Browse files
committed
Merge pull request #168 from MakozFriends/master
No more lints.
2 parents a303fd7 + 9277ec4 commit d275182

File tree

4 files changed

+26
-29
lines changed

4 files changed

+26
-29
lines changed

sc2reader/data/create_lookup.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
2-
31
abilities = dict()
42
with open('hots_abilities.csv', 'r') as f:
5-
for line in f:
6-
num, ability = line.strip('\r\n ').split(',')
7-
abilities[ability] = [""]*32
8-
9-
with open('command_lookup.csv','r') as f:
10-
for line in f:
11-
ability, commands = line.strip('\r\n ').split('|',1)
12-
abilities[ability] = commands.split('|')
13-
14-
with open('new_lookup.csv','w') as out:
15-
for ability, commands in sorted(abilities.items()):
16-
out.write(','.join([ability]+commands)+'\n')
3+
for line in f:
4+
num, ability = line.strip('\r\n ').split(',')
5+
abilities[ability] = [""]*32
6+
7+
with open('command_lookup.csv', 'r') as f:
8+
for line in f:
9+
ability, commands = line.strip('\r\n ').split('|', 1)
10+
abilities[ability] = commands.split('|')
11+
12+
with open('new_lookup.csv', 'w') as out:
13+
for ability, commands in sorted(abilities.items()):
14+
out.write(','.join([ability]+commands)+'\n')

sc2reader/engine/plugins/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
@loggable
1010
class ContextLoader(object):
11-
name='ContextLoader'
11+
name = 'ContextLoader'
1212

1313
def handleInitGame(self, event, replay):
1414
replay.units = set()

sc2reader/resources.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# -*- coding: utf-8 -*-
1+
# -*- coding: utf-8 -*-
22
from __future__ import absolute_import, print_function, unicode_literals, division
33

44
from collections import defaultdict, namedtuple
@@ -192,7 +192,6 @@ class Replay(Resource):
192192
#: Lists info for each user that is resuming from replay.
193193
resume_user_info = None
194194

195-
196195
def __init__(self, replay_file, filename=None, load_level=4, engine=sc2reader.engine, do_tracker_events=True, **options):
197196
super(Replay, self).__init__(replay_file, filename, **options)
198197
self.datapack = None
@@ -201,7 +200,7 @@ def __init__(self, replay_file, filename=None, load_level=4, engine=sc2reader.en
201200
# The current load level of the replay
202201
self.load_level = None
203202

204-
#default values, filled in during file read
203+
# default values, filled in during file read
205204
self.speed = ""
206205
self.type = ""
207206
self.game_type = ""
@@ -333,7 +332,7 @@ def load_details(self):
333332
self.map_hash = details['cache_handles'][-1].hash
334333
self.map_file = details['cache_handles'][-1]
335334

336-
#Expand this special case mapping
335+
# Expand this special case mapping
337336
if self.region == 'sg':
338337
self.region = 'sea'
339338

@@ -367,7 +366,7 @@ def load_map(self):
367366
self.map = self.factory.load_map(self.map_file, **self.opt)
368367

369368
def load_players(self):
370-
#If we don't at least have details and attributes_events we can go no further
369+
# If we don't at least have details and attributes_events we can go no further
371370
if 'replay.details' not in self.raw_data:
372371
return
373372
if 'replay.attributes.events' not in self.raw_data:

sc2reader/scripts/sc2printer.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,31 +84,31 @@ def main():
8484
description="""Prints basic information from Starcraft II replay and
8585
game summary files or directories.""")
8686
parser.add_argument('--recursive', action="store_true", default=True,
87-
help="Recursively read through directories of Starcraft II files [default on]")
87+
help="Recursively read through directories of Starcraft II files [default on]")
8888

8989
required = parser.add_argument_group('Required Arguments')
9090
required.add_argument('paths', metavar='filename', type=str, nargs='+',
91-
help="Paths to one or more Starcraft II files or directories")
91+
help="Paths to one or more Starcraft II files or directories")
9292

9393
shared_args = parser.add_argument_group('Shared Arguments')
9494
shared_args.add_argument('--date', action="store_true", default=True,
95-
help="print(game date [default on]")
95+
help="print(game date [default on]")
9696
shared_args.add_argument('--length', action="store_true", default=False,
97-
help="print(game duration mm:ss in game time (not real time) [default off]")
97+
help="print(game duration mm:ss in game time (not real time) [default off]")
9898
shared_args.add_argument('--map', action="store_true", default=True,
99-
help="print(map name [default on]")
99+
help="print(map name [default on]")
100100
shared_args.add_argument('--teams', action="store_true", default=True,
101-
help="print(teams, their players, and the race matchup [default on]")
101+
help="print(teams, their players, and the race matchup [default on]")
102102

103103
replay_args = parser.add_argument_group('Replay Options')
104104
replay_args.add_argument('--messages', action="store_true", default=False,
105-
help="print(in-game player chat messages [default off]")
105+
help="print(in-game player chat messages [default off]")
106106
replay_args.add_argument('--version', action="store_true", default=True,
107-
help="print(the release string as seen in game [default on]")
107+
help="print(the release string as seen in game [default on]")
108108

109109
s2gs_args = parser.add_argument_group('Game Summary Options')
110110
s2gs_args.add_argument('--builds', action="store_true", default=False,
111-
help="print(player build orders (first 64 items) [default off]")
111+
help="print(player build orders (first 64 items) [default off]")
112112

113113
arguments = parser.parse_args()
114114
for path in arguments.paths:

0 commit comments

Comments
 (0)