1
- from __future__ import division
1
+
2
2
import logging
3
3
import math
4
4
import os
5
5
import random
6
6
from collections import OrderedDict
7
- from itertools import ifilter
7
+
8
8
9
9
import time
10
10
from PIL import Image , ImageChops
@@ -229,10 +229,10 @@ def __get_border(cls, start, end, parts, res_x, res_y):
229
229
230
230
upper = offsets [start ]
231
231
lower = offsets [end + 1 ]
232
- for i in xrange (upper , lower ):
232
+ for i in range (upper , lower ):
233
233
border .append ((0 , i ))
234
234
border .append ((x , i ))
235
- for i in xrange (0 , x ):
235
+ for i in range (0 , x ):
236
236
border .append ((i , upper ))
237
237
border .append ((i , lower ))
238
238
return border
@@ -544,7 +544,7 @@ def _update_frame_preview(self, new_chunk_file_path, frame_num, part=1,
544
544
self ._update_frame_task_preview ()
545
545
546
546
def _put_image_together (self ):
547
- output_file_name = u "{}" .format (self .output_file , self .output_format )
547
+ output_file_name = "{}" .format (self .output_file , self .output_format )
548
548
logger .debug ('_put_image_together() out: %r' , output_file_name )
549
549
self .collected_file_names = OrderedDict (sorted (self .collected_file_names .items ()))
550
550
if not self ._use_outer_task_collector ():
@@ -554,7 +554,7 @@ def _put_image_together(self):
554
554
collector .finalize ().save (output_file_name , self .output_format )
555
555
else :
556
556
self ._put_collected_files_together (os .path .join (self .tmp_dir , output_file_name ),
557
- self .collected_file_names .values (), "paste" )
557
+ list ( self .collected_file_names .values () ), "paste" )
558
558
559
559
def mark_part_on_preview (self , part , img_task , color , preview_updater , frame_index = 0 ):
560
560
lower = preview_updater .get_offset (part )
@@ -580,7 +580,7 @@ def _mark_task_area(self, subtask, img_task, color, frame_index=0):
580
580
def _put_frame_together (self , frame_num , num_start ):
581
581
directory = os .path .dirname (self .output_file )
582
582
output_file_name = os .path .join (directory , self ._get_output_name (frame_num ))
583
- frame_key = unicode (frame_num )
583
+ frame_key = str (frame_num )
584
584
collected = self .frames_given [frame_key ]
585
585
collected = OrderedDict (sorted (collected .items ()))
586
586
if not self ._use_outer_task_collector ():
@@ -589,7 +589,7 @@ def _put_frame_together(self, frame_num, num_start):
589
589
collector .add_img_file (file )
590
590
collector .finalize ().save (output_file_name , self .output_format )
591
591
else :
592
- self ._put_collected_files_together (output_file_name , collected .values (), "paste" )
592
+ self ._put_collected_files_together (output_file_name , list ( collected .values () ), "paste" )
593
593
self .collected_file_names [frame_num ] = output_file_name
594
594
self ._update_frame_preview (output_file_name , frame_num , final = True )
595
595
self ._update_frame_task_preview ()
@@ -607,13 +607,13 @@ def build_dictionary(cls, definition):
607
607
parent = super (BlenderRenderTaskBuilder , cls )
608
608
609
609
dictionary = parent .build_dictionary (definition )
610
- dictionary [u 'options' ][u 'compositing' ] = definition .options .compositing
610
+ dictionary ['options' ]['compositing' ] = definition .options .compositing
611
611
return dictionary
612
612
613
613
@classmethod
614
614
def build_full_definition (cls , task_type , dictionary ):
615
615
parent = super (BlenderRenderTaskBuilder , cls )
616
- options = dictionary [u 'options' ]
616
+ options = dictionary ['options' ]
617
617
618
618
definition = parent .build_full_definition (task_type , dictionary )
619
619
definition .options .compositing = options .get ('compositing' , False )
0 commit comments