• JonB

    That's pretty interesting...

    Although I guess to set the caption would require figuring out which IPTC tag (maybe try 'Caption/Abstract', or just 'Caption'), and you'd be editing a copy, not the original...

    Does iOS provide IPTC editing functions? Looks like as part of CGImageProperties:
    tion/imageio/cgimageproperties?language=objc

    https://stackoverflow.com/questions/44517834/modifing-metadata-from-existing-phasset-seems-not-working

    Not clear if the approach here actually works to driectly modify the original.

    posted in Pythonista read more
  • JonB

    There are similar questions in the apple developer forums and stackoverflow .. it seems that apple did not expose captions via PhotoKit. So I don't think you can get it, even using objc.

    posted in Pythonista read more
  • JonB

    I'm curious why that broke -- are you holding onto a reference to the text view itself? That seems dangerous unless you store tableviewcells after creation so that you can reuse the actual cell and its contents when cell_for_row is called.

    posted in Pythonista read more
  • JonB

    @cvp Are you logging function enter AND exit? What could have happened is set_content_inset was the last method called, but then whatever the calling function was failed

    posted in Pythonista read more
  • JonB

    Okay, as it turns out it was not hard at all to backport the latest matplotlib.animation module so it works in pythonista. Obviously, things which rely on ffmpeg are not going to work, but to_jshtml does work, since it works by saving a sequence of temporary files, then encoding those files and embedding into html, with some js code to decode and play. The results is an html string that can be passed to ui.webview.load_html().

    You get this by first importing the package below in your code. Then ani.save would be replaced with to_jshtml and load_html.

    See README
    https://github.com/jsbain/pythonista_matplotlib_backports

    posted in Pythonista read more
  • JonB

    Sorry, looking at the Rubicon code again, the instance_methods attribute only gets filled on demand for the methods called by Rubicon.
    But the instance_method_ptrs should be filled whenever you try to access any methods in the class. (Or after _load_methods() is called on the objc class object, once. That might not be needed, not sure). Again, you want instance_method_ptrs.keys().

    jb

    posted in Pythonista read more
  • JonB

    @cvp you might need to call _load_methods on the object.

    posted in Pythonista read more
  • JonB

    Yes:

    https://github.com/ColdGrub1384/Pyto/blob/008bf515bee4a420ac820f1904d88521fb2f14ef/Pyto/Model/Python Bridging/UI/Views/PyTextView.swift

    The attribute TextView of the PyTextView object is a standard UITextView.

    And from pyto_ui.py:

      self.__py_view__ = __PyTextView__.newView()
    

    So
    TextView.__py_view__.TextView should give you the Rubicon ObjCInstance of the UITextView.

    Or, you might need to import rubicon.objc and call ObjCInstance on the result?

    Looking at Rubicon's ObjCInstance, it doesn't expose the methods and properties via dir, I don't think. But, you can find them in

            'instance_methods': 
            'instance_properties': 
    

    Which are dicts that maybe live in the ObjCClass of an object. So try

    print(Your_pyto_textview.__py_view__.TextView.objc_class.instance_methods.keys())
    

    posted in Pythonista read more
  • JonB

    I believe Rubicon objects have an ObjCClass or objc_class attribute. Are these pyto UI objects, or standards objects?

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!