本文整理匯總了Python中macostools.touched方法的典型用法代碼示例。如果您正苦於以下問題:Python macostools.touched方法的具體用法?Python macostools.touched怎麽用?Python macostools.touched使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類macostools
的用法示例。
在下文中一共展示了macostools.touched方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_touched
# 需要導入模塊: import macostools [as 別名]
# 或者: from macostools import touched [as 別名]
def test_touched(self):
# This really only tests that nothing unforeseen happens.
with test_support.check_warnings(('macostools.touched*',
DeprecationWarning), quiet=True):
macostools.touched(test_support.TESTFN)
示例2: settypecreator
# 需要導入模塊: import macostools [as 別名]
# 或者: from macostools import touched [as 別名]
def settypecreator(self, file):
file = Carbon.File.pathname(file)
record = self.mapfile(os.path.split(file)[1])
MacOS.SetCreatorAndType(file, record[2], record[1])
macostools.touched(fss)
# Convenience routines
示例3: drawToFile
# 需要導入模塊: import macostools [as 別名]
# 或者: from macostools import touched [as 別名]
def drawToFile(d, fn, msg="", showBoundary=rl_config._unset_, autoSize=1):
"""Makes a one-page PDF with just the drawing.
If autoSize=1, the PDF will be the same size as
the drawing; if 0, it will place the drawing on
an A4 page with a title above it - possibly overflowing
if too big."""
d = renderScaledDrawing(d)
c = Canvas(fn)
if msg:
c.setFont(rl_config.defaultGraphicsFontName, 36)
c.drawString(80, 750, msg)
c.setTitle(msg)
if autoSize:
c.setPageSize((d.width, d.height))
draw(d, c, 0, 0, showBoundary=showBoundary)
else:
#show with a title
c.setFont(rl_config.defaultGraphicsFontName, 12)
y = 740
i = 1
y = y - d.height
draw(d, c, 80, y, showBoundary=showBoundary)
c.showPage()
c.save()
if sys.platform=='mac' and not hasattr(fn, "write"):
try:
import macfs, macostools
macfs.FSSpec(fn).SetCreatorType("CARO", "PDF ")
macostools.touched(fn)
except:
pass
示例4: markfilename
# 需要導入模塊: import macostools [as 別名]
# 或者: from macostools import touched [as 別名]
def markfilename(filename,creatorcode=None,filetype=None,ext='PDF'):
try:
if creatorcode is None or filetype is None and ext is not None:
try:
creatorcode, filetype = _KNOWN_MAC_EXT[ext.upper()]
except:
return
macfs.FSSpec(filename).SetCreatorType(creatorcode,filetype)
macostools.touched(filename)
except:
pass
示例5: test_touched
# 需要導入模塊: import macostools [as 別名]
# 或者: from macostools import touched [as 別名]
def test_touched(self):
# This really only tests that nothing unforeseen happens.
macostools.touched(test_support.TESTFN)