jsbain / objc_hacks Goto Github PK
View Code? Open in Web Editor NEWexperiments with pythonista objc module
experiments with pythonista objc module
% flake8 . --count --select=E9,F63,F7,F82,Y --show-source --statistics
./blocktest.py:60:5: E999 SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
print 'The item at index',ind,'is', ObjCInstance(obj)
^
./filter_subviews.py:22:2: E999 SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
print 'find'+'me'
^
./history_popup.py:55:17: F821 undefined name 'ListDataSourceList'
self.items = ListDataSourceList([])
^
./keycommands.py:18:3: E999 SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
print 'hi'
^
./objc.py:164:13: F821 undefined name 'xrange'
for i in xrange(num_methods.value):
^
./objc.py:310:39: F821 undefined name 'long'
if not isinstance(key, (int, long)):
^
./objc.py:328:39: F821 undefined name 'long'
if not isinstance(key, (int, long)):
^
./objc.py:345:39: F821 undefined name 'long'
if not isinstance(key, (int, long)):
^
./objc.py:479:26: F821 undefined name 'unicode'
if isinstance(py_obj, unicode):
^
./objc.py:506:35: F821 undefined name 'basestring'
if not isinstance(url_or_path, basestring):
^
./objcblock.py:34:8: E999 SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
print self, idx , obj
^
./objcnew.py:233:24: F821 undefined name 'basestring'
if isinstance(result, basestring):
^
./objcnew.py:248:25: F821 undefined name 'basestring'
if isinstance(member, basestring):
^
./objcnew.py:345:13: F821 undefined name 'xrange'
for i in xrange(num_methods.value):
^
./objcnew.py:444:33: F821 undefined name 'long'
if not isinstance(key, (int, long)):
^
./objcnew.py:462:33: F821 undefined name 'long'
if not isinstance(key, (int, long)):
^
./objcnew.py:479:33: F821 undefined name 'long'
if not isinstance(key, (int, long)):
^
./objcnew.py:506:13: F821 undefined name 'xrange'
for i in xrange(num_methods.value):
^
./objcnew.py:535:43: F821 undefined name 'basestring'
elif typecode == ':' and isinstance(arg, basestring):
^
./objcnew.py:721:24: F821 undefined name 'unicode'
if isinstance(py_obj, unicode):
^
./objcnew.py:748:33: F821 undefined name 'basestring'
if not isinstance(url_or_path, basestring):
^
./objcnew.py:837:123: F821 undefined name 'xrange'
type_encoding = 'v%i@0:8%s' % (sizeof(c_void_p) * (num_args + 2), ''.join('@%i' % ((i+2) * sizeof(c_void_p),) for i in xrange(num_args)))
^
4 E999 SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
18 F821 undefined name 'ListDataSourceList'
22
Hi, I'm attempting to use the method swizzling in swizzle.py and I'm see that attempting to call the original method results in the following error (this happens with trying the test code in the main block as well as in my own test):
Traceback (most recent call last):
File "_ctypes/callbacks.c", line 234, in 'calling callback function'
File "/private/var/mobile/Containers/Shared/AppGroup/74CC34ED-493E-431F-9C45-5BD2EF3B2AE0/Pythonista3/Documents/firebaseapp/swizzle.py", line 146, in saveData
File "/var/containers/Bundle/Application/71C9338F-1BD7-4D52-9DAD-EE24DDF5139E/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 796, in __call__
method_name, kwarg_order = resolve_instance_method(obj, self.name, args, kwargs)
File "/var/containers/Bundle/Application/71C9338F-1BD7-4D52-9DAD-EE24DDF5139E/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 403, in resolve_instance_method
raise AttributeError('No method found for %s' % (name,))
AttributeError: No method found for originalsaveData
Could
elif isinstance(py_obj, list): # line 481 of obj_c.py
arr = NSMutableArray.array()
for obj in py_obj:
arr.addObject_(ns(obj))
return arr
be rewritten as
elif isinstance(py_obj, list): # line 481 of obj_c.py
return NSMutableArray.array([ns(obj) for obj in py_obj])
If so, would it matter?
@Phuket2 can you try running tableview_rowheight_tests.py (in same folder as the swizzle and tableview_rowheight.py), and paste the output here?
If i run the script objcblock and nsblock it says in the line where you call the function: cannot convert parameter to block
I'm on ipad air 2 (64bit)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.