Skip to content

Commit

Permalink
Remove usage of str() for Python 2 unicode compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
regan-sarwas committed Feb 3, 2021
1 parent 3204756 commit b5eed4a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
7 changes: 4 additions & 3 deletions Facility-Sync/create_new_facilities_fgdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@


# derived variables
DATESTAMP = str(datetime.date.today())
NEW_FGDB_NAME = "{0}_new{1}".format(FGDB_NAME, FGDB_EXT)
SAVED_FGDB_NAME = "{0}_{1}{2}".format(FGDB_NAME, datetime.date.today(), FGDB_EXT)
xdrive_fgdb = os.path.join(XDRIVE_FOLDER, FGDB_NAME + FGDB_EXT)
new_fgdb = os.path.join(WORKING_FOLDER, FGDB_NAME + "_new" + FGDB_EXT)
saved_fgdb = os.path.join(WORKING_FOLDER, FGDB_NAME + "_" + DATESTAMP + FGDB_EXT)
new_fgdb = os.path.join(WORKING_FOLDER, NEW_FGDB_NAME)
saved_fgdb = os.path.join(WORKING_FOLDER, SAVED_FGDB_NAME)
sde_tables = [os.path.join(CONNECTION_FILE, SDE_SCHEMA + table) for table in tables]
sde_fcs = [os.path.join(CONNECTION_FILE, SDE_SCHEMA + fc) for fc in fcs]

Expand Down
2 changes: 1 addition & 1 deletion ifsar_scripts/list-images.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def check_folder(folder, ext, outputter=None):
size = os.path.getsize(os.path.join(current_folder, filename))
except os.error:
pass
output = [current_folder, name, extension, str(size)]
output = [current_folder, name, extension, "{0}".format(size)]
if outputter is None:
print(",".join(output))
else:
Expand Down
3 changes: 1 addition & 2 deletions misc-reorg-scripts/fix_tml.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ def build_file_mapping(in_path, all_paths):
new_path = fix_file.find_replacement(old_path, moves)
print(old_path, new_path)
if new_path is not None and new_path != old_path:
new_path = str(new_path)
results.append((old_path, str(new_path)))
results.append((old_path, new_path))
return results


Expand Down

0 comments on commit b5eed4a

Please sign in to comment.