Skip to content

Commit

Permalink
stick to objctiveC
Browse files Browse the repository at this point in the history
  • Loading branch information
schriftgestalt committed Apr 26, 2024
1 parent 0f5c107 commit 3c6af45
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions DrawBot.glyphsPlugin/Contents/Resources/DrawBotDocument.py
Expand Up @@ -41,14 +41,9 @@ def init(self):
self._text = ""
return self

@property
def text(self):
return self._text

@text.setter
def text(self, value):
self._text = value

def setText_(self, text):
self._text = text

Expand All @@ -67,14 +62,13 @@ def windowController(self):
# pass

def dataRepresentationOfType_(self, aType):
print("__aType", aType)
if self.text and len(self.text) > 0:
return NSString.stringWithString_(self.text).dataUsingEncoding_(NSUTF8StringEncoding)
if self._text and len(self._text) > 0:
return NSString.stringWithString_(self._text).dataUsingEncoding_(NSUTF8StringEncoding)
else:
NSData.data()

def loadDataRepresentation_ofType_(self, data, aType):
self.text = NSString.alloc().initWithData_encoding_(data, NSUTF8StringEncoding)
self.setText_(NSString.alloc().initWithData_encoding_(data, NSUTF8StringEncoding))
return True

def writableTypes(self):
Expand Down

0 comments on commit 3c6af45

Please sign in to comment.