Ignore:
Timestamp:
1 Apr 2010, 11:11:30 (15 years ago)
Author:
uli
Message:

Remove old 'accesscodes' subdir when setting new datacenter dir.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt

    r5111 r5114  
    749749  ...   os.unlink(os.path.join(uploadpath, filename))
    750750
     751We also remove any existing 'accesscodes' subdir:
     752
     753  >>> import shutil
     754  >>> for filename in files:
     755  ...   if not os.path.isdir(os.path.join(uploadpath, filename)):
     756  ...     continue
     757  ...   if filename != 'accesscodes':
     758  ...     continue
     759  ...   shutil.rmtree(os.path.join(uploadpath, filename))
     760
    751761The new upload directory is now empty, except from the logs and other
    752762standard dirs, which are created automatically:
    753763
    754764  >>> sorted(os.listdir(uploadpath))
    755   ['accesscodes', 'finished', 'logs', 'unfinished']
     765  ['finished', 'logs', 'unfinished']
    756766
    757767
     
    794804
    795805  >>> sorted(os.listdir(uploadpath))
    796   ['accesscodes', 'finished', 'logs', 'myfaculties_zope.mgr.csv', 'unfinished']
     806  ['finished', 'logs', 'myfaculties_zope.mgr.csv', 'unfinished']
    797807
    798808We create and upload also a CSV file containing departments:
Note: See TracChangeset for help on using the changeset viewer.