-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathEditorClientAppDelegate.py
43 lines (31 loc) · 1.41 KB
/
EditorClientAppDelegate.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#
# EditorClientAppDelegate.py
# EditorClient
#
# Created by Rob Tillotson on 8/17/09.
# Copyright 2009 Rob Tillotson. All rights reserved.
#
from Foundation import *
from AppKit import *
from ODBEditorSuite import *
from fourcc import *
from EditorClientWorker import *
class EditorClientAppDelegate(NSObject):
def applicationDidFinishLaunching_(self, sender):
NSLog("Application did finish launching.")
def application_openFiles_(self, app, filenames):
for fn in filenames:
NSLog("application:openFiles: %s" % fn)
evt = NSAppleEventManager.sharedAppleEventManager().currentAppleEvent()
odbserver = evt.paramDescriptorForKeyword_(fourcc(keyFileSender))
if odbserver is not None:
odbserver = to_fourcc(odbserver.typeCodeValue())
odbtoken = evt.paramDescriptorForKeyword_(fourcc(keyFileSenderToken))
if odbtoken is not None:
odbtoken = odbtoken.data()
odbtitle = evt.paramDescriptorForKeyword_(fourcc(keyFileCustomPath))
if odbtitle is not None:
odbtitle = odbtitle.stringValue()
NSLog("ODB server %@, token %@, title %@", odbserver, odbtoken, odbtitle)
thread = EditorClientWorker.alloc().initWithODB(fn, 0, odbserver, odbtoken)
thread.start()