omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. arandomperson

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 1
    • Topics 4
    • Posts 13
    • Best 2
    • Controversial 0
    • Groups 0

    arandomperson

    @arandomperson

    4
    Reputation
    690
    Profile views
    13
    Posts
    1
    Followers
    0
    Following
    Joined Last Online

    arandomperson Unfollow Follow

    Best posts made by arandomperson

    • MusicRuntime: a module for controlling the Apple Music app.

      Hi there! I have been working on this module for the past few days and I think it's ready to be shared. Find it here.

      This provides the following classes,

      • MusicQueueViewer
        • Provides a viewer to select a song/songs in the queue.
      • MQVSong
        • A wrapper for MPMediaItem.
      • MusicPlayerController
        • Provides methods to replace and reorder the queue.

      Currently, for MusicPlayerController, those are the only two methods, but contributions are always welcome. And this requires the rubicon module.

      The repo also has two examples,
      Upnext, allows the user to select multiple songs to be moved up in the queue and to be played next.
      MusicStopper, allows the user to select the last song to be played, I find this useful when I am playing music to go to sleep.

      Have fun!

      posted in Pythonista
      arandomperson
      arandomperson
    • RE: using a C function

      @mikael faulthandler seems really useful, Thanks!

      posted in Pythonista
      arandomperson
      arandomperson

    Latest posts made by arandomperson

    • RE: MusicRuntime: a module for controlling the Apple Music app.

      @mikael I assume so but I haven’t tested it with any other players, nevertheless it would probably be easy to support them.

      posted in Pythonista
      arandomperson
      arandomperson
    • MusicRuntime: a module for controlling the Apple Music app.

      Hi there! I have been working on this module for the past few days and I think it's ready to be shared. Find it here.

      This provides the following classes,

      • MusicQueueViewer
        • Provides a viewer to select a song/songs in the queue.
      • MQVSong
        • A wrapper for MPMediaItem.
      • MusicPlayerController
        • Provides methods to replace and reorder the queue.

      Currently, for MusicPlayerController, those are the only two methods, but contributions are always welcome. And this requires the rubicon module.

      The repo also has two examples,
      Upnext, allows the user to select multiple songs to be moved up in the queue and to be played next.
      MusicStopper, allows the user to select the last song to be played, I find this useful when I am playing music to go to sleep.

      Have fun!

      posted in Pythonista
      arandomperson
      arandomperson
    • RE: Access UITableViewAutomaticDimension

      @mikael well, ever since the update, UITableViews are always in the native light theme and I want a native dark theme one. Other than that though... maybe I'm just crazy.

      posted in Pythonista
      arandomperson
      arandomperson
    • RE: Access UITableViewAutomaticDimension

      @cvp I Swear I tried that before lol. Thank you so much!

      posted in Pythonista
      arandomperson
      arandomperson
    • Access UITableViewAutomaticDimension

      Hello! I'm making a UITableView by scratch, and am trying to use the constant "UITableViewAutomaticDimension" for the row heights. But I am having trouble accessing it. I have tried using the C function "CFBundleGetDataPointerForName" and the following,

      lib = ctypes.CDLL(None)
      print(lib.UITableViewAutomaticDimension)
      pointer = ctypes.cast(lib.UITableViewAutomaticDimension, ctypes.c_void_p)
      print(objc_util.ObjCInstance(pointer))
      

      Any help would be great!

      posted in Pythonista
      arandomperson
      arandomperson
    • RE: Using FaceID

      @JonB yeah, changing c_void_p to c_byte still results in a crash with the same fault log, and setting the handler to None also results in a crash with the same fault log.

      posted in Pythonista
      arandomperson
      arandomperson
    • RE: Using FaceID

      @JonB oops my mistake, though it still crashes unfortunately.
      Thanks for the reply!

      posted in Pythonista
      arandomperson
      arandomperson
    • Using FaceID

      I'm trying to implement Face ID in a script, but following the example Touch ID scripts it just results in a crash, with faulthandler just saying Aborted

      This is what i'm using,

      from objc_util import *
      
      context = ObjCClass('LAContext').alloc().init()
      policy = 1
      reason = "FaceID Testing"
      
      def _handler(_cmd, success, error):
      	autherr = ObjCInstance(error).localizedDescription()
      	print(autherr)
      	if success:
      		print('authenicated')
      
      handler = ObjCBlock(_handler,restype = None, argtypes = [c_void_p, c_void_p, c_void_p])
      context.evaluatePolicy_localizedReason_reply_(policy, reason, handler)
      

      Using the "canEvaluatePolicy:error:" function, it returns true, so i'm assuming that Face ID works.
      Also setting policy to 2, defaults to passcode authentication.
      Of course it can as simple as @omz not adding "NSFaceIDUsageDescription" to pythonista's Info.plist

      Thanks for any help!

      posted in Pythonista
      arandomperson
      arandomperson
    • RE: using a C function

      @mikael faulthandler seems really useful, Thanks!

      posted in Pythonista
      arandomperson
      arandomperson
    • RE: using a C function

      @JonB Thanks for the help, I did manage to get it working by studying a couple of examples, but your code looks so much nicer.

      posted in Pythonista
      arandomperson
      arandomperson