getting file size for all dict files to be downloaded. coming to be 400mb or so.
[worddb.git] / libs / dmigrations / generator_utils.py
blobfad262e803a6b8b8aecf7d1317ecff375c20f463
1 from dmigrations.migration_db import MigrationDb
2 from django.conf import settings
4 def save_migration(output, migration_output, app_name):
5 """
6 If output flag is set, print migration out.
7 Else save it to disk.
8 """
9 if output:
10 print migration_output
11 else:
12 file_path = MigrationDb(
13 directory = settings.DMIGRATIONS_DIR
14 ).migration_path(app_name)
15 open(file_path, 'w').write(migration_output)
16 print "Created migration: %s" % file_path