Skip to content

Commit e2ec475

Browse files
committed
ui-macos/models.py: fix a compatibility problem on MacOS for PPC.
@objc.accessor isn't the right thing to use for a Core Data Validation function. Yowee, PyObjc sure is non-obvious.
1 parent 57e744d commit e2ec475

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ui-macos/models.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44

55
configchange_callback = setconnect_callback = None
6+
objc_validator = objc.signature('@@:N^@o^@')
67

78

89
def config_changed():
@@ -39,7 +40,7 @@ def subnet(self):
3940
def setSubnet_(self, v):
4041
self._k_subnet = v
4142
config_changed()
42-
@objc.accessor
43+
@objc_validator
4344
def validateSubnet_error_(self, value, error):
4445
#print 'validateSubnet!'
4546
return True, _validate_ip(value), error
@@ -49,7 +50,7 @@ def width(self):
4950
def setWidth_(self, v):
5051
self._k_width = v
5152
config_changed()
52-
@objc.accessor
53+
@objc_validator
5354
def validateWidth_error_(self, value, error):
5455
#print 'validateWidth!'
5556
return True, _validate_width(value), error
@@ -118,7 +119,7 @@ def setHost_(self, v):
118119
self._k_host = v
119120
self.setTitle_(None)
120121
config_changed()
121-
@objc.accessor
122+
@objc_validator
122123
def validateHost_error_(self, value, error):
123124
#print 'validatehost! %r %r %r' % (self, value, error)
124125
while value.startswith('-'):

0 commit comments

Comments
 (0)