UPD: first little 2to3 migration steps.
This commit is contained in:
@@ -96,17 +96,17 @@ class AdminCommand(object):
|
|||||||
|
|
||||||
input_file = os.path.join('django_project_config', 'additional_settings.py')
|
input_file = os.path.join('django_project_config', 'additional_settings.py')
|
||||||
output_file = os.path.join(django_base_dir, django_main_module, 'settings.py')
|
output_file = os.path.join(django_base_dir, django_main_module, 'settings.py')
|
||||||
with open(output_file, 'a') as f:
|
with open(output_file, 'ab') as f:
|
||||||
f.write(pkg_resources.resource_string(__package__, input_file))
|
f.write(pkg_resources.resource_string(__package__, input_file))
|
||||||
|
|
||||||
input_file = os.path.join('django_project_config', 'urls.py')
|
input_file = os.path.join('django_project_config', 'urls.py')
|
||||||
output_file = os.path.join(django_base_dir, django_main_module, 'urls.py')
|
output_file = os.path.join(django_base_dir, django_main_module, 'urls.py')
|
||||||
with open(output_file, 'w') as f:
|
with open(output_file, 'wb') as f:
|
||||||
f.write(pkg_resources.resource_string(__package__, input_file))
|
f.write(pkg_resources.resource_string(__package__, input_file))
|
||||||
|
|
||||||
input_file = os.path.join('django_project_config', 'settings-dav_base.py')
|
input_file = os.path.join('django_project_config', 'settings-dav_base.py')
|
||||||
output_file = os.path.join(django_base_dir, django_main_module, 'settings-dav_base.py')
|
output_file = os.path.join(django_base_dir, django_main_module, 'settings-dav_base.py')
|
||||||
with open(output_file, 'w') as f:
|
with open(output_file, 'wb') as f:
|
||||||
f.write(pkg_resources.resource_string(__package__, input_file))
|
f.write(pkg_resources.resource_string(__package__, input_file))
|
||||||
|
|
||||||
return posix.EX_OK
|
return posix.EX_OK
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class Command(BaseCommand):
|
|||||||
if pkg_resources.resource_exists(module_name, input_file):
|
if pkg_resources.resource_exists(module_name, input_file):
|
||||||
output_file = os.path.join(django_base_dir, django_main_module, settings_file_name)
|
output_file = os.path.join(django_base_dir, django_main_module, settings_file_name)
|
||||||
if not os.path.exists(output_file):
|
if not os.path.exists(output_file):
|
||||||
with open(output_file, 'w') as f:
|
with open(output_file, 'wb') as f:
|
||||||
f.write(pkg_resources.resource_string(module_name, input_file))
|
f.write(pkg_resources.resource_string(module_name, input_file))
|
||||||
|
|
||||||
module_meta_obj = ModuleMeta(module_name)
|
module_meta_obj = ModuleMeta(module_name)
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ class ScreenshotTestCase(SeleniumTestCase):
|
|||||||
)
|
)
|
||||||
path = os.path.join(self.screenshot_path, self.sanitize_filename(base_name))
|
path = os.path.join(self.screenshot_path, self.sanitize_filename(base_name))
|
||||||
if not os.path.isdir(self.screenshot_path):
|
if not os.path.isdir(self.screenshot_path):
|
||||||
os.makedirs(self.screenshot_path, 0700)
|
os.makedirs(self.screenshot_path, 0o700)
|
||||||
|
|
||||||
restore_size = False
|
restore_size = False
|
||||||
if resize:
|
if resize:
|
||||||
|
|||||||
@@ -737,7 +737,7 @@ class RegistrationForm(EventCreateForm):
|
|||||||
elif field_name == 'deadline_month':
|
elif field_name == 'deadline_month':
|
||||||
first_day = self._session_data.get('first_day')
|
first_day = self._session_data.get('first_day')
|
||||||
m = first_day.month - 1 - 1
|
m = first_day.month - 1 - 1
|
||||||
y = first_day.year + m / 12
|
y = first_day.year + m // 12
|
||||||
m = m % 12 + 1
|
m = m % 12 + 1
|
||||||
d = min(first_day.day, calendar.monthrange(y, m)[1])
|
d = min(first_day.day, calendar.monthrange(y, m)[1])
|
||||||
date = datetime.date(y, m, d)
|
date = datetime.date(y, m, d)
|
||||||
@@ -745,7 +745,7 @@ class RegistrationForm(EventCreateForm):
|
|||||||
elif field_name == 'deadline_quarter':
|
elif field_name == 'deadline_quarter':
|
||||||
first_day = self._session_data.get('first_day')
|
first_day = self._session_data.get('first_day')
|
||||||
m = first_day.month - 1 - 3
|
m = first_day.month - 1 - 3
|
||||||
y = first_day.year + m / 12
|
y = first_day.year + m // 12
|
||||||
m = m % 12 + 1
|
m = m % 12 + 1
|
||||||
d = min(first_day.day, calendar.monthrange(y, m)[1])
|
d = min(first_day.day, calendar.monthrange(y, m)[1])
|
||||||
date = datetime.date(y, m, d)
|
date = datetime.date(y, m, d)
|
||||||
|
|||||||
@@ -183,6 +183,6 @@ class RegistrationSuccessView(generic.DetailView):
|
|||||||
try:
|
try:
|
||||||
pk = self.request.session['registration_id']
|
pk = self.request.session['registration_id']
|
||||||
obj = self.model.objects.get(pk=pk)
|
obj = self.model.objects.get(pk=pk)
|
||||||
except KeyError, self.model.DoesNotExist:
|
except (KeyError, self.model.DoesNotExist):
|
||||||
obj = None
|
obj = None
|
||||||
return obj
|
return obj
|
||||||
|
|||||||
Reference in New Issue
Block a user