Module Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias Assign NameStore Call NameLoad Call NameLoad NameLoad Str ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad NameLoad Str Assign AttributeStore NameLoad attr Call NameLoad NameLoad Str Expr Call NameLoad NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Str keyword NameLoad keyword NameLoad Return IfExp CompareIs NameLoad Num NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr If Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr CompareLt NameLoad NameLoad orelse Print Str decorator_list decorator_list
N/A N/A os os.path join dirname shutil copyfile subprocess call PIPE django.test TestCase image_diet diet N/A TEST_DIR N/A join N/A dirname __file__ test_files DietTest N/A TestCase N/A setUp N/A N/A self N/A N/A N/A image_path N/A join TEST_DIR stockholm.jpg N/A N/A self test_image_path N/A join TEST_DIR test_image.jpg N/A N/A copyfile image_path N/A self test_image_path N/A tearDown N/A N/A self N/A N/A N/A N/A N/A os remove N/A self test_image_path N/A have_jpeg_tools N/A N/A self N/A N/A N/A retcode N/A call which jpegoptim || which jpegtran shell True stdout PIPE N/A N/A N/A retcode 0 True False N/A test_squeeze_jpeg N/A N/A self N/A N/A N/A N/A N/A diet settings DIET_JPEGOPTIM False N/A N/A N/A diet settings DIET_JPEGTRAN False N/A N/A N/A self assertEqual N/A N/A diet squeeze_jpeg N/A N/A N/A diet settings DIET_JPEGTRAN True N/A N/A N/A self assertEqual N/A N/A diet squeeze_jpeg jpegtran -copy none -progressive -optimize -outfile '%(file)s'.diet '%(file)s' && mv '%(file)s.diet' '%(file)s' N/A N/A N/A diet settings DIET_JPEGOPTIM True N/A N/A N/A diet settings DIET_JPEGTRAN False N/A N/A N/A self assertEqual N/A N/A diet squeeze_jpeg jpegoptim -f --strip-all '%(file)s' N/A test_squeeze_png N/A N/A self N/A N/A N/A N/A N/A diet settings DIET_OPTIPNG False N/A N/A N/A diet settings DIET_ADVPNG False N/A N/A N/A diet settings DIET_PNGCRUSH False N/A N/A N/A self assertEqual N/A N/A diet squeeze_png N/A N/A N/A diet settings DIET_OPTIPNG True N/A N/A N/A diet settings DIET_ADVPNG False N/A N/A N/A diet settings DIET_PNGCRUSH False N/A N/A N/A self assertEqual N/A N/A diet squeeze_png optipng -force -o7 '%(file)s' N/A N/A N/A diet settings DIET_OPTIPNG False N/A N/A N/A diet settings DIET_ADVPNG True N/A N/A N/A diet settings DIET_PNGCRUSH False N/A N/A N/A self assertEqual N/A N/A diet squeeze_png advpng -z4 '%(file)s' N/A N/A N/A diet settings DIET_OPTIPNG False N/A N/A N/A diet settings DIET_ADVPNG False N/A N/A N/A diet settings DIET_PNGCRUSH True N/A N/A N/A self assertEqual N/A N/A diet squeeze_png pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time '%(file)s' '%(file)s.diet' && mv '%(file)s.diet' '%(file)s' N/A N/A N/A diet settings DIET_OPTIPNG True N/A N/A N/A diet settings DIET_ADVPNG True N/A N/A N/A diet settings DIET_PNGCRUSH False N/A N/A N/A self assertEqual N/A N/A diet squeeze_png optipng -force -o7 '%(file)s' && advpng -z4 '%(file)s' N/A test_squeeze_gif N/A N/A self N/A N/A N/A N/A N/A diet settings DIET_GIFSICLE True N/A N/A N/A self assertEqual N/A N/A diet squeeze_gif gifsicle -O2 b'%(file)s' > '%(file)s'.diet && mv '%(file)s.diet' '%(file)s' N/A N/A N/A diet settings DIET_GIFSICLE False N/A N/A N/A self assertEqual N/A N/A diet squeeze_gif N/A test_squeeze N/A N/A self N/A N/A N/A N/A N/A self assertEqual N/A N/A diet squeeze /tmp/bla None N/A old_size N/A N/A N/A os stat N/A self test_image_path st_size N/A new_path N/A N/A diet squeeze N/A self test_image_path N/A new_size N/A N/A N/A os stat new_path st_size N/A N/A N/A self have_jpeg_tools N/A N/A N/A N/A self assertEqual new_path N/A self test_image_path N/A N/A N/A self assertTrue N/A new_size old_size N/A N/A Install jpegtran or jpegoptim to test shrinking N/A N/A