]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/ide/activegrid/util/gettersetter.py
1 #----------------------------------------------------------------------------
2 # Name: gettersetter.py
9 # Copyright: (c) 2004-2005 ActiveGrid, Inc.
10 # License: wxWindows License
11 #----------------------------------------------------------------------------
12 def gettersetter(list):
14 lowercase
= attr
[0].lower() + attr
[1:]
15 uppercase
= attr
[0].upper() + attr
[1:]
16 print " def get%s(self):" % uppercase
17 print " return self._%s" % lowercase
19 print " def set%s(self, %s):" % (uppercase
, lowercase
)
20 print " self._%s = %s" % (lowercase
, lowercase
)
23 def listgettersetter(list):
25 lowercase
= attr
[0].lower() + attr
[1:]
26 uppercase
= attr
[0].upper() + attr
[1:]
27 print " def get%s(self):" % uppercase
28 print " return self._%s" % lowercase
30 print " def add%s(self, %s):" % (uppercase
[:-1], lowercase
[:-1])
31 print " self._%s.append(%s)" % (lowercase
, lowercase
[:-1])
33 print " def remove%s(self, %s):" % (uppercase
[:-1], lowercase
[:-1])
34 print " self._%s.remove(%s)" % (lowercase
, lowercase
[:-1])