[Python-checkins] python/dist/src/Mac/Modules/cf cfsupport.py,1.17,1.18

jackjansen@sourceforge.net jackjansen@sourceforge.net
Mon, 13 May 2002 14:21:51 -0700


Update of /cvsroot/python/python/dist/src/Mac/Modules/cf
In directory usw-pr-cvs1:/tmp/cvs-serv20917/Python/Mac/Modules/cf

Modified Files:
	cfsupport.py 
Log Message:
Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.

Index: cfsupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/cf/cfsupport.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** cfsupport.py	12 May 2002 22:04:14 -0000	1.17
--- cfsupport.py	13 May 2002 21:21:49 -0000	1.18
***************
*** 51,54 ****
--- 51,55 ----
  #include <CFURL.h>
  #include <CFPropertyList.h>
+ #include <CFPreferences.h>
  #else
  #include <CoreServices/CoreServices.h>
***************
*** 166,169 ****
--- 167,181 ----
  """
  
+ variablestuff="""
+ #define _STRINGCONST(name) PyModule_AddObject(m, #name, CFStringRefObj_New(name))
+ _STRINGCONST(kCFPreferencesAnyApplication);
+ _STRINGCONST(kCFPreferencesCurrentApplication);
+ _STRINGCONST(kCFPreferencesAnyHost);
+ _STRINGCONST(kCFPreferencesCurrentHost);
+ _STRINGCONST(kCFPreferencesAnyUser);
+ _STRINGCONST(kCFPreferencesCurrentUser);
+ 
+ """
+ 
  Boolean = Type("Boolean", "l")
  CFTypeID = Type("CFTypeID", "l") # XXXX a guess, seems better than OSTypeType.
***************
*** 406,410 ****
  
  # Create the generator groups and link them
! module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff)
  CFTypeRef_object = CFTypeRefObjectDefinition('CFTypeRef', 'CFTypeRefObj', 'CFTypeRef')
  CFArrayRef_object = CFArrayRefObjectDefinition('CFArrayRef', 'CFArrayRefObj', 'CFArrayRef')
--- 418,422 ----
  
  # Create the generator groups and link them
! module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff, variablestuff)
  CFTypeRef_object = CFTypeRefObjectDefinition('CFTypeRef', 'CFTypeRefObj', 'CFTypeRef')
  CFArrayRef_object = CFArrayRefObjectDefinition('CFArrayRef', 'CFArrayRefObj', 'CFArrayRef')