Subversion Repositories SmartDukaan

Rev

Rev 19445 | Rev 19447 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 19445 Rev 19446
Line 10... Line 10...
10
dirs = os.listdir("./")
10
dirs = os.listdir("./")
11
for dir in dirs:
11
for dir in dirs:
12
    if os.path.isdir(os.path.join("./", dir)):
12
    if os.path.isdir(os.path.join("./", dir)):
13
        infile = dir + "/" + sys.argv[1]
13
        infile = dir + "/" + sys.argv[1]
14
        if not os.path.isfile(infile):
14
        if not os.path.isfile(infile):
-
 
15
            print "file is missing"
-
 
16
            shutil.copy2(default_image, infile)
-
 
17
        elif not os.stat(infile).st_size==0:
-
 
18
            print "file is of 0 size"
15
            shutil.copy2(default_image, infile)
19
            shutil.copy2(default_image, infile)
16
        outfile = dir + "/" + sys.argv[2]
20
        outfile = dir + "/" + sys.argv[2]
17
        if not (os.path.isfile(outfile) and os.stat(infile).st_size==0 and os.path.getmtime(outfile) > os.path.getmtime(infile)):
21
        if not (os.path.isfile(outfile) and os.path.getmtime(outfile) > os.path.getmtime(infile)):
18
            sys.stderr.write(infile)
22
            sys.stderr.write(infile)
19
            width = int(sys.argv[3])
23
            width = int(sys.argv[3])
20
            height = int(sys.argv[4])
24
            height = int(sys.argv[4])
21
            size = width, height
25
            size = width, height
22
            im = Image.open(infile)
26
            im = Image.open(infile)