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.
Pythonista Clock "Gadget"
-
Very nice! I put a few comments at the bottom of the gist.
-
@ccc, thanks for the thoughtful comments. I am working on it. You mentioned in the comment to turn the gist into a repo but I am not sure how to to that - Specifically taking the code in the gist and putting in a repo. I must admit that GIT is completely a new thing for me coming from the CVS/SVN world (which I forgot too lol, just getting old).
I figure that GIT and REPO information would be useful to members of this community in general, perhaps someone can put together a basic Hello World of GIT?
-
It is funny because I had the same problem at the beginning...
I could create repos but I could not figure out how to add new files to them. The trick is that you have to find a "+" sign on the repo main page that lets you add a new file to the repo. You have two repos: https://github.com/ltddev/MyPythonista and https://github.com/ltddev/mygitrepo so you already figured out how to create repos.
Try going to one of those and look for
branch: master <repo name> / +
. If you click that+
sign at the right, you should be able to add a new file (PythonistaClockGadget.py
) and then copy the source from the gist and paste it into this new file. One of the key advantages of a repo over a gist is that others can send you suggested changes ("pull requests") that you can choose to accept or reject. -
@ccc In the process of adding my files to an existing repository but in the meantime cleaned up code as per your comments on the gist (https://gist.github.com/2ce6a942f5198fbf2de8)
-
There should be another + that is four of five lines further down the page.
That is the + that lets you add a file. It should be to the right of a popup menu that says
branch: master
. -
@ccc, I went to my "Pythonista stuff" repo, but the "+" sign I thought you were talking about had only options to create new repository, organization or collaborator. I did not see any choice to add or create files. I went to another repository of mine, a clone, which had files in it and then I see the "+" sign you are talking about. It seems that you can only add new files that way if the repo is not empty as my Pythonista one was. Once I added a readme for the repo then I came to a different UI when in the repo and was able to start adding content.
-
Code now in my MyPythonista repp at:
https://github.com/ltddev/MyPythonista/tree/master
Feel free to improve it in any way you like.
-
Awesome!
-
In my hands, the original gist version did not display the webvew, only the "X". The repo version's pyui file (which has been "pretty printed") does not load. I'm on the 1.6 beta.
-
@polymerchm,I copied and pasted the files from the GIST page to the repo page, I could not see or figure out any other way to get files into the repo. Seemed like an error-prone way to me, back to the "copy and paste" days.
When you say does not display the webview, do you mean you see the other subviews, ie, the Button and Switch controls? Right off the top of my head it may be that the beta is not loading either the html that has an embedded svg markkup, the svg object itself, the javascript, or some combination. I would be curious to know from anyone that has the 1.6 beta whether the svg clock will render in the main Pythonista editor which is the case in 1.5.
-
@ltddev - I am seeing the same things as @polymerch. Got the code from the GIST page first and the webview is blank except for the X in the upper left and < in the upper right. I also brought down the repo but the pyui file is not valid. The pyui from the GIST page looks OK in the pyui editor display but I suspect there may be an issue with it. The webview section does not look like it is the correct location and is defined as a subview of the clock display - looks fishy to me.
One other item. On my iPad location.get_location() returns None and this causes the code that follows to throw an exception.
-
I opened
issues
on the bugs that @polymerchm and @wradcliffe mentioned above. -
@ccc, thanks makes me feel like a "real" developer with real defects on my plate again :). To make my efforts worthwhile and provide motivation, do you see my little app making it to the Pythonsista Tools collection? To end up there would give me a lot of satisfaction because it is in fact a "utility" and I am enhancing it to speak out the time on a s electable interval.
As far as location bug, first I should add proper error and exception handling which it of course does not do. Second when using device capabilities like the GPS should of course be checking that the feature is available, that its turned on and so on and works in some manner ,or, handle gracefully when not. Unhanded exceptions to be absolutely avoided when possible.
-
If you keep closing those issues then the gadget will surely make its way into Pythonista-Tools! I am glad to hear that the todos make you feel at home.
I think that
location.get_location()
will return None in all the cases that you mentioned above so the exception handling in the issue should cover them all.The P1 issue is that we still can not see the clock. I assume that you are not using Pythonista v1.6 beta but are instead using v1.5 from the Apple App Store. This issue might be v1.6 specific.
-
@ccc Yes, I am using App Store version of 1.5 of Pythonista, not 1.6 beta and so it may indeed be specific to 1.6 beta.
-
Yes, I think sidebar presentation is broken in the current beta, looking into it.
-