File tree Expand file tree Collapse file tree 4 files changed +20
-10
lines changed Expand file tree Collapse file tree 4 files changed +20
-10
lines changed Original file line number Diff line number Diff line change 168
168
169
169
import sc2reader
170
170
171
+ try :
172
+ raw_input # Python 2
173
+ except NameError :
174
+ raw_input = input # Python 3
175
+
171
176
172
177
def run (args ):
173
178
#Reset wipes the destination clean so we can start over.
@@ -367,12 +372,12 @@ def reset(args):
367
372
elif not os .path .isdir (args .dest ):
368
373
exit ("Cannot reset, destination must be directory: {0}" , args .dest )
369
374
370
- print 'About to reset directory: {0}\n All files and subdirectories will be removed.' .format (args .dest )
375
+ print ( 'About to reset directory: {0}\n All files and subdirectories will be removed.' .format (args .dest ) )
371
376
choice = raw_input ('Proceed anyway? (y/n) ' )
372
377
if choice .lower () == 'y' :
373
378
args .log .write ('Removing old directory: {0}\n ' .format (args .dest ))
374
379
if not args .dryrun :
375
- print args .dest
380
+ print ( args .dest )
376
381
shutil .rmtree (args .dest )
377
382
else :
378
383
sys .exit ("Script Aborted" )
@@ -511,7 +516,7 @@ def main():
511
516
try :
512
517
run (parser .parse_args ())
513
518
except KeyboardInterrupt :
514
- print "\n \n Script Interupted. Process Aborting"
519
+ print ( "\n \n Script Interupted. Process Aborting" )
515
520
516
521
if __name__ == '__main__' :
517
522
main ()
Original file line number Diff line number Diff line change @@ -172,15 +172,15 @@ def main():
172
172
173
173
for path in args .paths :
174
174
for file_name in sc2reader .utils .get_files (path , depth = 0 ):
175
- print "CREATING: {0}" .format (file_name )
175
+ print ( "CREATING: {0}" .format (file_name ) )
176
176
db .add (Game (sc2reader .read_file (file_name ), db ))
177
177
178
178
db .commit ()
179
179
180
- print list (db .query (distinct (Person .name )).all ())
180
+ print ( list (db .query (distinct (Person .name )).all () ))
181
181
182
182
#for row in db.query(distinct(Person.name)).all():
183
- # print row
183
+ # print( row)
184
184
185
185
186
186
def load_session (args ):
Original file line number Diff line number Diff line change 18
18
for line in new_units :
19
19
new_unit_name = line .strip ().split (',' )[1 ]
20
20
if new_unit_name not in UNIT_LOOKUP :
21
- print "{0},{1}" .format (new_unit_name ,new_unit_name )
21
+ print ( "{0},{1}" .format (new_unit_name ,new_unit_name ) )
22
22
23
- print
24
- print
23
+ print ( '' )
24
+ print ( '' )
25
25
26
26
ABIL_LOOKUP = dict ()
27
27
for entry in pkgutil .get_data ('sc2reader.data' , 'ability_lookup.csv' ).split ('\n ' ):
33
33
for line in new_abilities :
34
34
new_ability_name = line .strip ().split (',' )[1 ]
35
35
if new_ability_name not in ABIL_LOOKUP :
36
- print "{0},{1}" .format (new_ability_name ,new_ability_name )
36
+ print ( "{0},{1}" .format (new_ability_name ,new_ability_name ) )
Original file line number Diff line number Diff line change 38
38
39
39
import sc2reader
40
40
41
+ try :
42
+ raw_input # Python 2
43
+ except NameError :
44
+ raw_input = input # Python 3
45
+
41
46
decisions = dict ()
42
47
43
48
You can’t perform that action at this time.
0 commit comments