Update icon and Add info
This commit is contained in:
@ -0,0 +1,3 @@
|
||||
"""
|
||||
Resource data converters
|
||||
"""
|
24
.eggs/py2app-0.12-py3.6.egg/py2app/converters/coredata.py
Normal file
24
.eggs/py2app-0.12-py3.6.egg/py2app/converters/coredata.py
Normal file
@ -0,0 +1,24 @@
|
||||
"""
|
||||
Automatic compilation of CoreData model files
|
||||
"""
|
||||
import subprocess, os
|
||||
from py2app.decorators import converts
|
||||
from py2app.util import momc, mapc
|
||||
|
||||
@converts(suffix=".xcdatamodel")
|
||||
def convert_datamodel(source, destination, dry_run=0):
|
||||
destination = os.path.splitext(destination)[0] + ".mom"
|
||||
|
||||
if dry_run:
|
||||
return
|
||||
|
||||
momc(source, destination)
|
||||
|
||||
@converts(suffix=".xcmappingmodel")
|
||||
def convert_mappingmodel(source, destination, dry_run=0):
|
||||
destination = destination[:-4] + ".cdm"
|
||||
|
||||
if dry_run:
|
||||
return
|
||||
|
||||
mapc(source, destination)
|
72
.eggs/py2app-0.12-py3.6.egg/py2app/converters/nibfile.py
Normal file
72
.eggs/py2app-0.12-py3.6.egg/py2app/converters/nibfile.py
Normal file
@ -0,0 +1,72 @@
|
||||
"""
|
||||
Automatic compilation of XIB files
|
||||
"""
|
||||
from __future__ import print_function
|
||||
import subprocess, os
|
||||
from py2app.decorators import converts
|
||||
from py2app.util import check_output
|
||||
import time
|
||||
|
||||
# XXX: _run_nibtool is an experiment while researching an odd
|
||||
# failure of py2app: when _run_nibtool is None py2app will often
|
||||
# (but for from everytime) fail when there are NIB files in the
|
||||
# project. The failure is very odd: writing to sys.stderr fails
|
||||
# with EGAIN as the errno, and subsequently the interpreter basicly
|
||||
# crashes.
|
||||
#
|
||||
# This workaround seems to fix that issue for now.
|
||||
#
|
||||
def _run_nibtool(source, destination):
|
||||
pid = os.fork()
|
||||
if pid == 0:
|
||||
os.setsid()
|
||||
xit = subprocess.call([_get_ibtool(), '--compile', destination, source])
|
||||
os._exit(xit)
|
||||
else:
|
||||
pid, status = os.waitpid(pid, 0)
|
||||
if os.WEXITSTATUS(status) != 0:
|
||||
raise RuntimeError("ibtool failed (%r -> %r)"%(source, destination))
|
||||
|
||||
#_run_nibtool = None
|
||||
|
||||
gTool = None
|
||||
def _get_ibtool():
|
||||
global gTool
|
||||
if gTool is None:
|
||||
if os.path.exists('/usr/bin/xcrun'):
|
||||
try:
|
||||
gTool = check_output(['/usr/bin/xcrun', '-find', 'ibtool'])[:-1]
|
||||
except subprocess.CalledProcessError:
|
||||
raise IOError("Tool 'ibtool' not found")
|
||||
else:
|
||||
gTool = 'ibtool'
|
||||
|
||||
return gTool
|
||||
|
||||
@converts(suffix=".xib")
|
||||
def convert_xib(source, destination, dry_run=0):
|
||||
destination = destination[:-4] + ".nib"
|
||||
|
||||
print("compile %s -> %s"%(source, destination))
|
||||
if dry_run:
|
||||
return
|
||||
|
||||
if _run_nibtool is None:
|
||||
subprocess.check_call([_get_ibtool(), '--compile', destination, source])
|
||||
else:
|
||||
_run_nibtool(source, destination)
|
||||
#time.sleep(1)
|
||||
|
||||
@converts(suffix=".nib")
|
||||
def convert_nib(source, destination, dry_run=0):
|
||||
destination = destination[:-4] + ".nib"
|
||||
print("compile %s -> %s"%(source, destination))
|
||||
|
||||
if dry_run:
|
||||
return
|
||||
|
||||
if _run_nibtool is None:
|
||||
subprocess.check_call([_get_ibtool, '--compile', destination, source])
|
||||
else:
|
||||
_run_nibtool(source, destination)
|
||||
#time.sleep(1)
|
Reference in New Issue
Block a user