Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions examples/sc2autosave.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@

import sc2reader

try:
raw_input # Python 2
except NameError:
raw_input = input # Python 3


def run(args):
#Reset wipes the destination clean so we can start over.
Expand Down Expand Up @@ -367,12 +372,12 @@ def reset(args):
elif not os.path.isdir(args.dest):
exit("Cannot reset, destination must be directory: {0}", args.dest)

print 'About to reset directory: {0}\nAll files and subdirectories will be removed.'.format(args.dest)
print('About to reset directory: {0}\nAll files and subdirectories will be removed.'.format(args.dest))
choice = raw_input('Proceed anyway? (y/n) ')
if choice.lower() == 'y':
args.log.write('Removing old directory: {0}\n'.format(args.dest))
if not args.dryrun:
print args.dest
print(args.dest)
shutil.rmtree(args.dest)
else:
sys.exit("Script Aborted")
Expand Down Expand Up @@ -511,7 +516,7 @@ def main():
try:
run(parser.parse_args())
except KeyboardInterrupt:
print "\n\nScript Interupted. Process Aborting"
print("\n\nScript Interupted. Process Aborting")

if __name__ == '__main__':
main()
6 changes: 3 additions & 3 deletions examples/sc2store.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,15 @@ def main():

for path in args.paths:
for file_name in sc2reader.utils.get_files(path, depth=0):
print "CREATING: {0}".format(file_name)
print("CREATING: {0}".format(file_name))
db.add(Game(sc2reader.read_file(file_name), db))

db.commit()

print list(db.query(distinct(Person.name)).all())
print(list(db.query(distinct(Person.name)).all()))

#for row in db.query(distinct(Person.name)).all():
# print row
# print(row)


def load_session(args):
Expand Down
8 changes: 4 additions & 4 deletions new_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
for line in new_units:
new_unit_name = line.strip().split(',')[1]
if new_unit_name not in UNIT_LOOKUP:
print "{0},{1}".format(new_unit_name,new_unit_name)
print("{0},{1}".format(new_unit_name,new_unit_name))

print
print
print('')
print('')

ABIL_LOOKUP = dict()
for entry in pkgutil.get_data('sc2reader.data', 'ability_lookup.csv').split('\n'):
Expand All @@ -33,4 +33,4 @@
for line in new_abilities:
new_ability_name = line.strip().split(',')[1]
if new_ability_name not in ABIL_LOOKUP:
print "{0},{1}".format(new_ability_name,new_ability_name)
print("{0},{1}".format(new_ability_name,new_ability_name))
5 changes: 5 additions & 0 deletions sc2reader/scripts/sc2attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@

import sc2reader

try:
raw_input # Python 2
except NameError:
raw_input = input # Python 3

decisions = dict()


Expand Down