Changeset 344


Ignore:
Timestamp:
10/28/07 23:18:53 (17 years ago)
Author:
Nicholas Riley
Message:

setup.py: Note that the bundle bit needs setting.

RetroStatus.py: Launch/quit Apple Backup, to work around its periodic
failure when left running all the time.

Location:
trunk/RetroStatus
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/RetroStatus/RetroStatus.py

    r343 r344  
    135135### Retrospect event handlers
    136136
    137 def retrospectstart(autolaunchboolean): pass
     137def retrospectstart(autolaunchboolean):
     138    try:
     139        app(id='com.apple.Backup').quit(timeout=5)
     140    except CommandError:
     141        addEvent('Apple Backup failed to quit', 'Please check on it.')
     142
    138143def scriptstart(scriptname, startdate): pass
    139144# yes, this really should be "remotetname"
     
    181186
    182187def retrospectquit():
     188    # can use launch() in newer appscript versions without CommandError
     189    app(id='com.apple.Backup').activate()
    183190    stopeventloop()
    184191
  • trunk/RetroStatus/setup.py

    r201 r344  
    1717                        plist=dict(NSAppleScriptEnabled=True,
    1818                                   CFBundleIdentifier='net.sabi.RetroStatus'))))
     19
     20# don't forget to set the bundle bit:
     21# % SetFile -a B "dist/Retrospect Event Handler"
     22
     23# XXX can't do this from Python:
     24#
     25#     >>> f.FSGetCatalogInfo(kFSCatInfoFinderInfo)[2]
     26#     Carbon.File.FSSpec((-100, 118904, 'Retrospect Event Handler'))
     27#     >>> f.FSGetCatalogInfo(kFSCatInfoFinderInfo)[2].FSpGetFInfo()
     28#     Traceback (most recent call last):
     29#       File "<stdin>", line 1, in ?
     30#     MacOS.Error: (-43, 'File not found')
Note: See TracChangeset for help on using the changeset viewer.