Skip to content

Commit 1b1ed4d

Browse files
committed
OSX: Improve app startup time
Importing everything (*) from AppKit takes a while, since we got 3 scripts doing that, startup could take up to few seconds. This change makes script import only what they need, improving startup time to fraction of second.
1 parent b19272a commit 1b1ed4d

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

src/ui-macos/main.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
import sys
22
import os
33
import pty
4-
from AppKit import *
4+
from AppKit import (
5+
objc,
6+
NSApp,
7+
NSApplicationMain,
8+
NSAttributedString,
9+
NSFileHandle,
10+
NSFileHandleDataAvailableNotification,
11+
NSImage,
12+
NSMenu,
13+
NSMenuItem,
14+
NSNotificationCenter,
15+
NSObject,
16+
NSStatusBar,
17+
NSVariableStatusItemLength,
18+
)
519
import my
620
import models
721
import askpass

src/ui-macos/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from AppKit import *
1+
from AppKit import (objc, NSObject)
22
import my
33

44

src/ui-macos/my.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import os
2-
from AppKit import *
2+
from AppKit import (
3+
NSBundle,
4+
NSData,
5+
NSDictionary,
6+
NSImage,
7+
NSUserDefaults,
8+
)
39
import PyObjCTools.AppHelper
410

511

0 commit comments

Comments
 (0)