Skip to content

Commit

Permalink
Merge pull request #97 from ginabythebay/master
Browse files Browse the repository at this point in the history
write output using self.stdout.write()
  • Loading branch information
palewire committed Mar 23, 2017
2 parents fb19ef3 + 1370443 commit e608d4e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions bakery/management/commands/build.py
@@ -1,5 +1,4 @@
import os
import six
import sys
import gzip
import shutil
Expand Down Expand Up @@ -109,7 +108,7 @@ def init_build_dir(self):
# Destroy the build directory, if it exists
logger.debug("Initializing %s" % self.build_dir)
if self.verbosity > 1:
six.print_("Initializing build directory")
self.stdout.write("Initializing build directory")
if os.path.exists(self.build_dir):
shutil.rmtree(self.build_dir)

Expand All @@ -122,7 +121,7 @@ def build_static(self, *args, **options):
"""
logger.debug("Building static directory")
if self.verbosity > 1:
six.print_("Building static directory")
self.stdout.write("Building static directory")

management.call_command(
"collectstatic",
Expand Down Expand Up @@ -166,7 +165,7 @@ def build_media(self):
"""
logger.debug("Building static directory")
if self.verbosity > 1:
six.print_("Building media directory")
self.stdout.write("Building media directory")
if os.path.exists(settings.MEDIA_ROOT) and settings.MEDIA_URL:
shutil.copytree(
settings.MEDIA_ROOT,
Expand All @@ -181,7 +180,7 @@ def build_views(self):
for view_str in self.view_list:
logger.debug("Building %s" % view_str)
if self.verbosity > 1:
six.print_("Building %s" % view_str)
self.stdout.write("Building %s" % view_str)
view = get_callable(view_str)
view().build_method()

Expand Down Expand Up @@ -225,7 +224,7 @@ def copytree_and_gzip(self, source_dir, target_dir):
# ... let the world know...
logger.debug("Gzipping %s" % filename)
if self.verbosity > 1:
six.print_("Gzipping %s" % filename)
self.stdout.write("Gzipping %s" % filename)

# ... create the new file in the build directory ...
f_in = open(og_file, 'rb')
Expand Down

0 comments on commit e608d4e

Please sign in to comment.