• charmaex

    Thank you all for your help.

    After some fumbling around I decided to close the UI and then start the action.
    This was the easiest way without having to change much code :)

    posted in Pythonista read more
  • charmaex

    Thanks for your reply.

    Maybe my example was a bit to simple.

    time.sleep(5) is a placeholder for downloading files (which takes some time).
    print c indicates, that the download is finished. So this should follow the sleep.
    My problem is that the b isn't printed before the download starts.

    If I only run button() everything works fine. Running button() via the ui prints b and c at the same time (after 5 secs).
    I want it to print b, work, print c.

    posted in Pythonista read more
  • charmaex

    I wrote a script that is controlled via an ui and outputs what it does through the console.

    My problem is that it doesn't output the data in realtime.
    My code works like the following example.
    The time.sleep(5) is just some time consuming task.
    I would like to have an output like this

    a
    b
    waiting 5 seconds
    c
    d

    Instead the output is

    a
    waiting 5 seconds
    b
    c
    d

    # coding: utf-8
    
    import ui, time, tempfile
    
    ui_file = '[{"selected" : false,"frame" : "{{0, 0}, {240, 240}}","class" : "View","nodes" : [{"selected" : true,"frame" : "{{75, 49}, {80, 32}}","class" : "Button","nodes" : [],"attributes" : {"action" : "button","frame" : "{{80, 104}, {80, 32}}","title" : "Button","class" : "Button","uuid" : "269E121F-FCD6-478B-B6CD-2F2C2D3E2ED8","font_size" : 15,"name" : "button1"}}],"attributes" : {"enabled" : true,"background_color" : "RGBA(1.000000,1.000000,1.000000,1.000000)","tint_color" : "RGBA(0.000000,0.478000,1.000000,1.000000)","border_color" : "RGBA(0.000000,0.000000,0.000000,1.000000)","flex" : ""}}]'
    
    def button(sender):
        print 'b'
        time.sleep(5)
        print 'c'
        
    open('Test_abcd.pyui', 'w').write(ui_file)
    
    print 'a'
    v = ui.load_view('Test_abcd')
    v.present('sheet')
    v.wait_modal()
    print 'd'
    

    posted in Pythonista read more
  • charmaex

    I have some workflows that I solely use for markdown and some for taskpaper. I think all of us.

    I would love to have an option to have a "tag-styled" option to define the file-extension it works with.
    This would save the "if extension is not x stop workflow" and more important:
    It could clean your workflow list as it could be filtered so you see only executable workflows. If you have a md open you'll see only md and unspecified workflows.

    posted in Editorial read more
  • charmaex

    Hi there,

    I want to create a file within a specified folder (using a template) and then have the keyboard opened to start right away.

    Right now I have two options:

    1. use "create document" and have to move the file manually
    2. use "set file content" and "open document" and have to tap on the screen to invoke the keyboard.

    I also tested "replace selected text" and added the cursor but this didn't help either.

    Is there a way to create a file in a dropbox folder and start typing right away?

    posted in Editorial read more
  • charmaex

    Okay, maybe an idea for a future release to add the option "open in edit mode" to "open document" :)

    posted in Editorial read more
  • charmaex

    Okay :-/

    Is there a way to open a folder and then use create document?

    posted in Editorial read more
  • charmaex

    Thanks for the hint.
    Somehow thought tags were only for uploading ;)

    posted in Editorial read more
  • charmaex

    Is there a way to import a Pythonista file into Editorial? A simple py file is easy but I want to import a py file with a pyui.
    Is there a way?

    posted in Editorial read more
  • charmaex

    Thanks for your help.
    I finally copied the text from the pyui file and create a __temp.pyui.

    posted in Editorial read more
  • charmaex

    Okay.
    As I already have a pyui file - is there a way to convert a pyui into python commands?

    posted in Editorial read more
  • charmaex

    Thank you for the help.

    I think I haven't explained it well.

    I have a python script with ui which I would like to run as an Editorial workflow.

    As far as I understand your solution it is to get a pyui file saved in Editorial?

    posted in Editorial read more
  • charmaex

    I'm trying to upload tar files to the dropbox using this:

    get_client().put_file(path_for_tar_in_db, see_below ,True)
    

    I tried so far:

    see_below = open(path,'r')
    see_below = path
    see_below = tarfile.open(path,'r')
    

    Nothing helped so far.
    First one makes corrupted files.
    Second creates txt files.
    And last one just errors.

    Can somebody please help me? :)

    posted in Pythonista read more
  • charmaex

    Thank you all!
    cccs solution works fine :)

    posted in Pythonista read more
  • charmaex

    Thank you ccc I changed the upload to the way you wrote it and the upload seems to work fine now.

    Still getting ReadError when downloading the files like this:

    download_file(s[0], ziel)
    tarfile.open(ziel, 'r:*').extractall('')

    The file appears within the folder still not able to untar.

    posted in Pythonista read more
  • charmaex

    Sadly it isn't working. Still getting a ReadError :-/

    posted in Pythonista read more
  • charmaex

    Hi,

    I'm looking for a way to open other apps with Pythonista. I'm aware of webbrowser.open('appurl://') but this doesn't help with apps which don't have an URL-scheme.
    And how can I specify the app a file is opened in? console.openin() opens a pop up but I would like to skip that and directly open the file in an app.

    Thanks in advance :)

    posted in Pythonista read more
  • charmaex

    Thanks for the help.

    The workaround with upload to Dropbox and the import within GoodNotes is a nice idea but I'm not sure if the default "open in"-dialogue isn't easier.

    console.open_in(file_path)
    Show the iOS “Open in...” menu for the specified file.

    If an application was selected in the menu, its bundle identifier will be returned (for example 'com.getdropbox.Dropbox'). If the menu was cancelled, or no application is installed that can open the file, the return value is None.

    With this I can open the file but have to choose the app. I'm searching for a way to skip the dialogue and set the chosen bundle identifier in the script.

    posted in Pythonista read more
  • charmaex

    I tried to open the photos app with Pythonista. As I found 'photos-redirect://' this isn't a problem anymore.

    The problem that still is present is that I create a pdf with Pythonista (got a nice script here in the forum). The created pdf then should be opened in GoodNotes which I use for viewing, annotate, highlighting et cetera. To achieve this I can use "console.open_in(file)' and then manually select GoodNotes.
    With another app I own (Workflow) it is possible to tell the iOS' Open In... popup what app is chosen. Just questioning myself if this isn't somehow possible with Pythonista too :)

    posted in Pythonista read more
Internal error.

Oops! Looks like something went wrong!