• TheRealBret

    Indeed - I’m very happy to see the new template. Thank you!

    My offer still stands - I would like a way to give a donation to @omz to help offset continued development of Pythonista. I can’t see how my payment a year ago is helping today.

    posted in Pythonista read more
  • TheRealBret

    I really want to have a new Xcode template for Pythonista 3. I realize that I've already bought Pythonista so I'm not generating new income for @omz.... so I hereby pledge to send money via Paypal/Zelle (or any other method) to @omz to help support his time for the production of a new Xcode template. I'd gladly pay $25 for a new template. I'd even pay this annually if it would be updated regularly.

    Thoughts anyone? @omz?? How can we help get a new Xcode template made?

    posted in Pythonista read more
  • TheRealBret

    How did you get in-app purchases to work? Were you able to code that in python or did you have to include C code? I’d like to do the same for my App Store app.
    Thanks!

    posted in Pythonista read more
  • TheRealBret

    Thanks. Will give it a try and test an upload to TestFlight too.

    posted in Pythonista read more
  • TheRealBret

    Looks like the texinfo hack needs to be modified. The code signing process uses file(1) to check the type of file in the package, and file(1) identifies executable code by checking against different file types and scoring each file type. Apple modified the matching "magic" for python to look for python keywords like "def", "import", "try", "except", etc and each use gives a higher score to python. So for the tex info hack to work, it needs to occur more frequently than the python keywords. Some files just need a single texinfo line; other files need 400+ copies of the texinfo line (some of the python checks only examine the first 4096 characters of the file). Its easy to modify the script above to accomplish this, but hardly elegant.

    Hopefully somebody will find this useful and find a simple fix.... like perhaps there's another file type that short-circuits the checking magic? Also, the Apple developer documentation say that script files could go into a specially named subfolder, which would be much simpler, but I've haven't gotten this to work.

    posted in Pythonista read more
  • TheRealBret

    I spoke too soon. I had to upgrade Xcode because of iOS11 compatibility, and now I'm back to getting the code signing errors for all the .py files, even if they have the texinfo header. Building apps for local distribution works fine, I just can't sign the code as part of the validation process for the App Store.

    posted in Pythonista read more
  • TheRealBret

    Yes you can publish apps to the App Store. As indicated above, you need to be a registered developer etc. You also need to use the modified Xcode package which includes the “texinfo” workaround.

    If your app idea is just for family, distribute it using TestFlight and avoid the app approval process and Apple’s UI rules etc. It’s like a private App Store, and you can send it to up to 2000 people.

    posted in Pythonista read more
  • TheRealBret

    @JonB The texinfo trick continues to work. Had an app accepted just last week.

    posted in Pythonista read more
  • TheRealBret

    I already have the calendar and reminder descriptions set to "${PRODUCT_NAME} needs X access"), and I am able to add a reminder, using the built-in Pythonista reminders library. It also passes the initial code which forces a check. I've confirmed in the settings and I do have the access to calendar in the 'on' state.

    posted in Pythonista read more
  • TheRealBret

    I am trying to add an appointment to the native iOS calendar. I have the following code which I took from this forum last year.

    from  objc_util import *
    from ctypes import POINTER
    import threading
    import calendar, time
    
    store = ObjCClass('EKEventStore').alloc().init()
    
    access_granted = threading.Event()
    def completion(_self, granted, _error):
        access_granted.set()
    completion_block = ObjCBlock(completion, argtypes=[c_void_p, c_bool, c_void_p])
    store.requestAccessToEntityType_completion_(0, completion_block)
    access_granted.wait()
    
    event = ObjCClass('EKEvent').eventWithEventStore_(store)
    
    event.title = 'test'
    event.startDate = ObjCClass('NSDate').dateWithTimeIntervalSince1970_(time.mktime(time.strptime('2017-06-18 12:00:00', '%Y-%m-%d %H:%M:%S')))
    event.endDate = ObjCClass('NSDate').dateWithTimeIntervalSince1970_(time.mktime(time.strptime('2017-06-18 13:00:00', '%Y-%m-%d %H:%M:%S')))
    event.setCalendar_(store.defaultCalendarForNewEvents())
    LP_c_void_p = POINTER(c_void_p)
    err = LP_c_void_p()
    store.saveEvent_span_error_(event, 0, err) 
    

    The code works just fine in Pythonista. A new calendar event is created, after optionally asking for permission to the calendar. I've run this code in both Pythonista 2.7 and 3.

    When I copy/paste this exact code into my Xcode project, it crashes when trying to set a value to the event.title parameter - I inserted console alerts between each line and it doesn't appear after this line. I'm not an expert in the objective C interface, so I'm perplexed why it works in the app but not in Xcode.

    Any help is appreciated.

    Thanks!

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!