Changeset 2709
- Timestamp:
- 04/17/06 09:05:40 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/magic-removal/django/core/management.py
r2693 r2709 4 4 import django 5 5 from django.core.exceptions import ImproperlyConfigured 6 import os, re, s ys, textwrap6 import os, re, shutil, sys, textwrap 7 7 from optparse import OptionParser 8 8 from django.utils import termcolors … … 632 632 if f.endswith('.pyc'): 633 633 continue 634 fp_old = open(os.path.join(d, f), 'r') 635 fp_new = open(os.path.join(top_dir, relative_dir, f.replace('%s_name' % app_or_project, name)), 'w') 634 path_old = os.path.join(d, f) 635 path_new = os.path.join(top_dir, relative_dir, f.replace('%s_name' % app_or_project, name)) 636 fp_old = open(path_old, 'r') 637 fp_new = open(path_new, 'w') 636 638 fp_new.write(fp_old.read().replace('{{ %s_name }}' % app_or_project, name).replace('{{ %s_name }}' % other, other_name)) 637 639 fp_old.close() 638 640 fp_new.close() 641 shutil.copymode(path_old, path_new) 639 642 640 643 def startproject(project_name, directory):
