__future__ print

This commit is contained in:
j 2016-08-31 01:33:41 +02:00
parent 5ced5cf791
commit c409b63f25
2 changed files with 6 additions and 4 deletions

View file

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
from __future__ import print_function
import time
@ -22,7 +23,7 @@ class Command(BaseCommand):
count = pos = models.Item.objects.count()
while offset <= count:
for i in models.Item.objects.all().order_by('id')[offset:offset+chunk]:
print pos, i.public_id
print(pos, i.public_id)
i.save()
time.sleep(1) #dont overload db
pos -= 1

View file

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
from __future__ import print_function
import os
@ -13,8 +14,8 @@ from ... import models
def link(src, target):
if not os.path.exists(target):
ox.makedirs(os.path.dirname(target))
print src
print '\t', target
print(src)
print('\t', target)
os.symlink(src, target)
class Command(BaseCommand):
@ -28,7 +29,7 @@ class Command(BaseCommand):
for i in models.Item.objects.all():
for f in i.files.all():
path = f.normalize_item_path()
print path
print(path)
if settings.CONFIG['site']['folderdepth'] == 4:
path = os.path.join(path[0], path)
if f.data: