printrun-src/printrun/power/osx.py

changeset 46
cce0af6351f0
parent 15
0bbb006204fc
equal deleted inserted replaced
45:c82943fb205f 46:cce0af6351f0
39 # we'll need to convert our strings before use 39 # we'll need to convert our strings before use
40 try: 40 try:
41 encoding = CoreFoundation.kCFStringEncodingASCII 41 encoding = CoreFoundation.kCFStringEncodingASCII
42 except AttributeError: 42 except AttributeError:
43 encoding = 0x600 43 encoding = 0x600
44 string = string.encode('ascii')
44 cfstring = CoreFoundation.CFStringCreateWithCString(None, string, encoding) 45 cfstring = CoreFoundation.CFStringCreateWithCString(None, string, encoding)
45 return objc.pyobjc_id(cfstring.nsstring()) 46 return objc.pyobjc_id(cfstring.nsstring())
46 47
47 def AssertionCreateWithName(framework, a_type, 48 def AssertionCreateWithName(framework, a_type,
48 a_level, a_reason): 49 a_level, a_reason):

mercurial