-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsetup.py
77 lines (69 loc) · 3.28 KB
/
setup.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
"""
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup
# The version number; do not change this manually! It is updated by bumpversion (https://github.com/c4urself/bump2version)
__version__ = "0.10.1"
# The file that contains the main application
APP = ["src/textinator.py"]
# Include additional python modules here; probably not the best way to do this
# but I couldn't figure out how else to get py2app to include modules in the src/ folder
DATA_FILES = [
"src/appkitgui.py",
"src/confirmation_window.py",
"src/icon.png",
"src/icon_paused.png",
"src/loginitems.py",
"src/macvision.py",
"src/pasteboard.py",
"src/utils.py",
]
# These values will be included by py2app into the Info.plist file in the App bundle
# See https://developer.apple.com/documentation/bundleresources/information_property_list?language=objc
# for more information
PLIST = {
# LSUIElement tells the OS that this app is a background app that doesn't appear in the Dock
"LSUIElement": True,
# CFBundleShortVersionString is the version number that appears in the App's About box
"CFBundleShortVersionString": __version__,
# CFBundleVersion is the build version (here we use the same value as the short version)
"CFBundleVersion": __version__,
# NSDesktopFolderUsageDescription is the message that appears when the app asks for permission to access the Desktop folder
# Likewise for NSDocumentsFolderUsageDescription and NSDownloadsFolderUsageDescription
"NSDesktopFolderUsageDescription": "Textinator needs access to your Desktop folder to detect new screenshots. "
"If you have changed the default location for screenshots, "
"you will also need to grant Textinator full disk access in "
"System Preferences > Security & Privacy > Privacy > Full Disk Access.",
"NSDocumentsFolderUsageDescription": "Textinator needs access to your Documents folder to detect new screenshots. ",
"NSDownloadsFolderUsageDescription": "Textinator needs access to your Downloads folder to detect new screenshots. ",
# NSAppleEventsUsageDescription is the message that appears when the app asks for permission to send Apple events
"NSAppleEventsUsageDescription": "Textinator needs permission to send AppleScript events to add itself to Login Items.",
# NSServices is a list of services that the app provides that will appear in the Services menu
# For more information on NSServices, see: https://developer.apple.com/documentation/bundleresources/information_property_list/nsservices?language=objc
"NSServices": [
{
"NSMenuItem": {"default": "Detect Text With Textinator"},
"NSMessage": "detectTextInImage",
"NSPortName": "Textinator",
"NSUserData": "detectTextInImage",
"NSRequiredContext": {"NSTextContent": "FilePath"},
"NSSendTypes": ["NSPasteboardTypeURL"],
"NSSendFileTypes": ["public.image"],
},
],
}
# Options for py2app
OPTIONS = {
# The icon file to use for the app (this is App icon in Finder, not the status bar icon)
"iconfile": "icon.icns",
"plist": PLIST,
}
setup(
app=APP,
data_files=DATA_FILES,
name="Textinator",
options={"py2app": OPTIONS},
setup_requires=["py2app"],
)