os x setup
This commit is contained in:
parent
004b577f9f
commit
296df41d2c
|
@ -1,17 +1,24 @@
|
|||
from os.path import exists
|
||||
from re import match
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
from Configuration import Configuration
|
||||
from Setup import Setup
|
||||
|
||||
class SetupOSX(Setup):
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, launcher_path, data_file_paths,
|
||||
config_file_path="config"):
|
||||
Setup.__init__(self)
|
||||
self.launcher_path = launcher_path
|
||||
self.data_file_paths = data_file_paths
|
||||
self.config_file_path = config_file_path
|
||||
|
||||
def setup(self):
|
||||
config = Configuration()
|
||||
setup_section = config.get_section("setup")
|
||||
version = setup_section["version"]
|
||||
name = self.translate_title()
|
||||
setup_obj = Setup()
|
||||
version = config.get_section("setup")["version"]
|
||||
name = setup_obj.translate_title()
|
||||
plist = dict(
|
||||
CFBundleIconFile=name,
|
||||
CFBundleName=name,
|
||||
|
@ -21,7 +28,17 @@ class SetupOSX(Setup):
|
|||
CFBundleIdentifier='org.' + name.lower())
|
||||
setup(name=name,
|
||||
version=version,
|
||||
app=[dict(script=setup_section["init-script"], plist=plist)],
|
||||
app=[dict(script=self.launcher_path, plist=plist)],
|
||||
setup_requires=["py2app"],
|
||||
options=dict(py2app=dict(arch="i386",)),
|
||||
data_files=setup_section["osx-includes"])
|
||||
data_files=self.data_file_paths)
|
||||
config_path = "dist/%s.app/Contents/Resources/%s" % \
|
||||
(name, self.config_file_path)
|
||||
if exists(config_path):
|
||||
lines = open(config_path).readlines()
|
||||
fp = open(config_path, "w")
|
||||
for line in lines:
|
||||
if match("^\W*fullscreen\W*=\W*yes\W*", line):
|
||||
fp.write("fullscreen = no\n")
|
||||
else:
|
||||
fp.write(line)
|
||||
|
|
Loading…
Reference in New Issue