diff options
author | Avery Pennarun <apenwarr@gmail.com> | 2011-05-07 23:09:47 -0400 |
---|---|---|
committer | Avery Pennarun <apenwarr@gmail.com> | 2011-05-07 23:16:42 -0400 |
commit | e2ec475de3e70e32da202d96099a94fa4e98885b (patch) | |
tree | 7378eacabec92d23600382cfd05680fc9341dddb | |
parent | 57e744daddd14d628a1641290f9595191307cc43 (diff) |
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.
-rw-r--r-- | ui-macos/models.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ui-macos/models.py b/ui-macos/models.py index c4cbe8b..e71fce5 100644 --- a/ui-macos/models.py +++ b/ui-macos/models.py @@ -3,6 +3,7 @@ import my configchange_callback = setconnect_callback = None +objc_validator = objc.signature('@@:N^@o^@') def config_changed(): @@ -39,7 +40,7 @@ class SshuttleNet(NSObject): def setSubnet_(self, v): self._k_subnet = v config_changed() - @objc.accessor + @objc_validator def validateSubnet_error_(self, value, error): #print 'validateSubnet!' return True, _validate_ip(value), error @@ -49,7 +50,7 @@ class SshuttleNet(NSObject): def setWidth_(self, v): self._k_width = v config_changed() - @objc.accessor + @objc_validator def validateWidth_error_(self, value, error): #print 'validateWidth!' return True, _validate_width(value), error @@ -118,7 +119,7 @@ class SshuttleServer(NSObject): self._k_host = v self.setTitle_(None) config_changed() - @objc.accessor + @objc_validator def validateHost_error_(self, value, error): #print 'validatehost! %r %r %r' % (self, value, error) while value.startswith('-'): |