• The problem is that Apple changed the API a bit for the file open dialog. Whereas before they allowed people to select folders with it they no longer do. OMZ will need to add the open folder dialog to the app as well for it to work properly. The author of Textastic is having to do the same thing and that app should be updated by the time iOS 13 is released. I doubt Pythonista will have the same luck.

  • aiohttp can easily be installed using stash + pip.

    there is hardly ever any reason to use in_background, since those get queued up on the interpreter thread. you can define your own threading based decorator such as

    def run_async(func): from threading import Thread from functools import wraps @wraps(func) def async_func(*args, **kwargs): func_hl = Thread(target = func, args = args, kwargs = kwargs) func_hl.start() return func_hl return async_func
  • https://forum.omz-software.com/topic/3115/ui-and-device-rotation-monitoring/2

    Your root view would be one the custom views above, which implement layout. Then within layout, you can check the orientation using ui.WebView().eval_js('window.orientation') returns 0, 90, 180, or 270. (it's possible the webview needs to be added to a view and visible for this to work, though it can be 1x1)

    You would then use self.transform=ui.Transform.rotation(angle), and also reset the size to proper w and height, which you will have to swap when it rotations 90 degrees.

  • Hi Gents

    Well its still an ongoing saga.. I seem to have got something wrong. The app worked well until I archived it and then when I pushed up to apple it came back with a bunch of errors. So started to look through the code and tried to build it again and then it started giving the following error and failing the build.

    ld: warning: ignoring file /Users/schilds/Desktop/PythonistaAppTemplate- Master/PythonistaAppTemplate/PythonistaKit.framework/PythonistaKit, missing required architecture x86_64 in file /Users/schilds/Desktop/PythonistaAppTemplate- Master/PythonistaAppTemplate/PythonistaKit.framework/PythonistaKit (2 slices)
    Undefined symbols for architecture x86_64:
    "OBJC_CLASS$_PAConsoleImageView", referenced from:
    objc-class-ref in libpythonista_appui.a(PAStandaloneOutputView.o)
    "_CanvasGetImage", referenced from:
    -[PAStandaloneOutputView canvasFlushed:] in libpythonista_appui.a(PAStandaloneOutputView.o)
    "_IsWaiting", referenced from:
    -[PAStandaloneOutputView textFieldShouldReturn:] in libpythonista_appui.a(PAStandaloneOutputView.o)
    "_LineRead", referenced from:
    -[PAStandaloneOutputView textFieldShouldReturn:] in libpythonista_appui.a(PAStandaloneOutputView.o)
    "OBJC_CLASS$_PythonInterpreter", referenced from:
    objc-class-ref in PAAppDelegate.o
    objc-class-ref in libpythonista_appui.a(PAStandaloneOutputView.o)
    "OBJC_CLASS$_PAEExtensionContext", referenced from:
    objc-class-ref in PAAppDelegate.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    I don't think its the template but any suggestions please...

  • @idchlife If you really want to create a photo from an ui.Image without passing via a temporary file, you can use Objective-C but it it is not a nice code 😂

    # only to have an ui.Image import ui img = ui.Image.named('test:Bridge') # Create a PHAsset from an ui.Image (not from a PIL Image) from objc_util import * import threading NSBundle.bundleWithPath_('/System/Library/Frameworks/Photos.framework').load() PHPhotoLibrary = ObjCClass('PHPhotoLibrary') PHAssetChangeRequest = ObjCClass('PHAssetChangeRequest') lib = PHPhotoLibrary.sharedPhotoLibrary() def change_block(): req = PHAssetChangeRequest.creationRequestForAssetFromImage_(img) def perform_changes(): lib.performChangesAndWait_error_(change_block, None) t = threading.Thread(target=perform_changes) t.start() t.join()
Internal error.

Oops! Looks like something went wrong!