Skip to content

Commit

Permalink
Move logging to outside of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ggatward committed Jul 31, 2016
1 parent 8ef60cb commit bbb03f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sat_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,9 @@ def prep_export_tree(org_name):
os.system("rm -rf " + helpers.EXPORTDIR + "/" + org_name + "*/")

# We need to re-generate the 'listing' files as we will have overwritten some during the merge
msg = "Rebuilding listing files..."
helpers.log_msg(msg, 'INFO')
print msg
create_listing_file(helpers.EXPORTDIR)

for root, directories, filenames in os.walk(helpers.EXPORTDIR):
Expand All @@ -372,9 +375,6 @@ def create_listing_file(directory):
"""
Function to create the listing file containing the subdirectories
"""
msg = "Rebuilding listing files..."
helpers.log_msg(msg, 'INFO')
print msg
listing_file = open(directory + "/listing", "w")
sorted_subdirs = sorted(get_immediate_subdirectories(directory))
for directory in sorted_subdirs:
Expand Down

0 comments on commit bbb03f1

Please sign in to comment.