omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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.


    Display script version in top status bar

    Pythonista
    1
    1
    1303
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cvp
      cvp last edited by cvp

      I program my scripts on my ipad, in local Pythonista folders.
      But some scripts are written for my wife, then I copy these scripts on Pythonista iCloud folder, and they are executed by tapping an home screen icon pointing to pythonista3://script_name?action=run&root=icloud.
      But, sometimes, I forget to copy my modified script from local to iCloud.
      Thus, I've decided to display in the status bar (at top) of the iDevice, a label showing the version of the running script, so I can check if the script executed by my wife is the last version.
      For that:
      - a module VersionInStatusBar.py is installed in site-packages folder
      here
      - these lines are added at top of my scripts

      from  VersionInStatusBar import VersionInStatusBar
      version = 'nn.n '
      VersionInStatusBar(version=version)
      
      - this line is added in the will_close def, to remove the label from status bar
      
      VersionInStatusBar(version=False)
      

      Don't be estonished by the green "log" label. My pythonista_startup.py displays that when the logging of @dgelessus is active (thanks and happy new year to him)

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Powered by NodeBB Forums | Contributors