omz:forum

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

    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 0
    • Topics 3
    • Posts 6
    • Best 0
    • Controversial 0
    • Groups 0

    offtheradar

    @offtheradar

    0
    Reputation
    477
    Profile views
    6
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    offtheradar Unfollow Follow

    Latest posts made by offtheradar

    • UnboundLocalError when accessing location.is_authorised() inside function

      UnboundLocalError when accessing location.is_authorised() inside function

      When I try:

      import location
      
          def get_direction():
              if location.is_authorized():
      		#do something
      

      I get an UnboundLocalError: local variable 'location' referenced before assignment.

      But the similar code works with other modules e.g:

      import time
      
          def get_time_diff():
              if time.time() > 1234:
      		#do something
      

      How can I get around the UnboundLocalError? Importing the location module inside the function works, but I don't want to have to import it within each function that uses location.

      Maybe I'm missing something obvious so any suggestions are appreciated!

      posted in Pythonista
      offtheradar
      offtheradar
    • RE: How do I vertically align text within a label?

      Thanks @omz & @Phuket2. my_label.size_to_fit() worked to achieve the alignment I wanted.

      posted in Pythonista
      offtheradar
      offtheradar
    • How do I vertically align text within a label?

      When creating a label with the frame attribute set, how can the vertical alignment of text be set within the height of the label? I want the text top aligned not center which appears to be the default.

      Thanks!

      posted in Pythonista
      offtheradar
      offtheradar
    • RE: Documentation on appex widget functions?

      Something else I can't find details on are the icons used in the widget examples.

      E.g. iow:ios7_minus_outline_32

      Is there a list of icons we can access?

      posted in Pythonista
      offtheradar
      offtheradar
    • RE: Documentation on appex widget functions?

      Thanks, got it. I didn't know about the help feature.

      posted in Pythonista
      offtheradar
      offtheradar
    • Documentation on appex widget functions?

      Where do I find documentation on the appex module widget functions?

      The page below doesn't cover get_widget_view etc.

      http://omz-software.com/pythonista/docs/ios/appex.html

      Thanks!

      posted in Pythonista
      offtheradar
      offtheradar