Changeset 10:b4d7edccf837 in misc


Ignore:
Timestamp:
03/12/07 04:33:20 (5 years ago)
Author:
Eriol
Branch:
misc
Convert:
svn:e60e002c-0983-44b9-b2ae-8842d539f768/misc@13
Message:

Refactored

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trac-wikifileuploader.py

    r9 r10  
    2020 
    2121    for f in os.listdir(file_dir): 
    22         if os.path.isfile(os.path.join(file_dir, f)): 
    23             size = os.stat(f)[6] 
     22        file_to_upload = os.path.join(file_dir, f) 
     23 
     24        if os.path.isfile(file_to_upload): 
     25            size = os.stat(file_to_upload)[6] 
    2426            q = """INSERT INTO attachment (type, id, filename, size, time, 
    2527                                           description, author, ipnr) values 
     
    3032            con.commit() 
    3133 
    32             shutil.copyfile(os.path.join(file_dir, f), 
     34            shutil.copyfile(file_to_upload, 
    3335                            os.path.join(trac_env_dir, 
    3436                                         'attachments', 
Note: See TracChangeset for help on using the changeset viewer.