Changeset 573


Ignore:
Timestamp:
07/22/09 18:19:35 (15 years ago)
Author:
Nicholas Riley
Message:

update_dates.py: Fix plist format before passing to plistlib if
necessary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Update Dates/update_dates.py

    r566 r573  
    5656Paper = EagleFiler.documents['Paper.eflibrary']
    5757
    58 sources = os.path.exists(PREFERENCES_PATH) and \
    59           readPlist(PREFERENCES_PATH).get('Sources', []) or []
     58if not Paper.exists():
     59    EagleFiler.open(os.path.expanduser('~/Documents/Paper/Paper.eflibrary'))
     60
     61def read_sources():
     62    return readPlist(PREFERENCES_PATH).get('Sources', [])
     63
     64if os.path.exists(PREFERENCES_PATH):
     65    try:
     66        sources = read_sources()
     67    except:
     68        from subprocess import call
     69        call(['plutil', '-convert', 'xml1', PREFERENCES_PATH])
     70        sources = read_sources()
     71else:
     72    sources = []
    6073
    6174def update_all():
Note: See TracChangeset for help on using the changeset viewer.