 I've created a Python App for MacOS to show Voting Power in the MenuBar

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@therealwolf·
0.000 HBD
 I've created a Python App for MacOS to show Voting Power in the MenuBar
<center>![votingpowerapp.png](https://steemitimages.com/DQmdbg1vwEU5jM3osMin4oVK8e3aToiPzzr2WCRa1phqzM1/votingpowerapp.png)</center>

-----

For a while now, I wanted to have a way to see how high my Voting Power % is without refreshing steemd.com. In the best case, since I’m working on a Mac, it should be a menu bar app. An app that is purely in the top bar.

Even though I have found something similar (https://steemit.com/steem/@knoopx/get-your-steeem-wallet-details-in-your-os-x-menu-bar-bitbar-plugin)I could simply not get it to work. 
Ruby Gem Install failed, Little Snitch got into an endless loop asking me to deny or allow the connection. All in all just a horrible experience.

That’s why I wanted to do it myself.

<center><h1>The Finished Script</h1></center>

First let me give you the end product and below you can read the story of how I developed it, what problems I encountered and where I need help from you - the community.

You will find the script & instruction here: 

https://github.com/therealwolf42/votingpowerbar

 If you have any questions - let me know in the comments.

---

<center><h1> Story</h1></center>

Even though I’m a programmer, I haven’t done a lot of Python or Javascript coding. But those languages are the only ones next to Ruby, as far as I know, that have up2date libraries. Steem-js and steem for python. I also tried dsteem, but at the time I wrote that script I couldn't get through it. Still an amazing library, @almost-digital.

At first I tried to implement my idea through javascript and electron. Electron because it would be an easy to way to also make the solution available for windows and linux.

I actually like javascript since it is pretty high-level and has a clean coding-structure. After a bit of search, I found a module called “menubar” (https://github.com/maxogden/menubar) which made it relatively easy to create a menubar app. 

After few hours try and error - I created something which looked like this.

<center>![](https://img1.steemit.com/300x300/https://steemitimages.com/DQmYAAGCEgG5CJQjzFAniuTKcBi1jrKxDpfJPYkxMDYwaD5/image.png)</center>

Not bad. But I wanted to implement a way to quickly and easily edit the name of which the voting power should be calculated. Sadly, menubar didn’t offer a way to use click-events for anything else than the icon itself. And even then - the opened window looked horrible.

<center>https://img1.steemit.com/400x400/https://steemitimages.com/DQmQvUguz1BhFNBrBH15TG2k9RNEK5LctnmpKmQ9PkDbTQj/image.png
_(Image from github of menubar)_</center>

And if this wasn’t enough: the final compiled solution was around 150mb.. and that was way too big.

Due to my missing knowledge in Javascript I didn’t want to go further and tried my luck with python.

After joining Steem, I’ve tried my hands on a few things. Through this I already had a few hours of coding with python.But when I opened the document it was, if I had forgotten everything. I like python because it is fast and “easy” to write but this simplicity requires a good knowledge of the syntax. And that I don’t have.

Nevertheless - I tried my best. I used “rumps” to create the macbar app and this actually worked. Even tough I didn’t integrate everything that I WANTED to ingrate. Simply because my skills are not good enough to understand every mistake I did.

And it worked

<center>
https://img1.steemit.com/300x300/https://steemitimages.com/DQmYs5QmK1uMt6NVgernQra3iXDd4eHT1wfF4z9gp9mZJ9K/image.png</center>


Well kind of.  Only until  I build the app with py2app in release mode. When I build it in alias mode, which means that I can only run it on my local machine - everything ran fine. But due to an error (Detected missing constraints for private .. -which after a google search is a known but not fixed bug) I simply couldn’t run the app.

And here I am now. I have the app which runs but sadly only as a python script with a few bugs.

----

<center><h1>I need your help</h1></center>

These bugs, I can’t solve by myself and thus would like to ask the dev-community for assistance:

EIT: I've fixed the 1st bug and will commit the changes once I've succesfully added multi-account-support. :)

1.) This bug is general and not specific to the script. Whenever I use the steem.api.votingpower (regardless if it is steemjs,dsteem or python steem)  - the voting power is delayed. Means: it is accurate on steemd.com but not through the api and usually doesn’t update for a few hours. Only when an upvote is used the % gets refreshed. For this I have created the option to see how much time has passed and how much % is gained since the start. But this might be wrong - depending on when you start the app.

2.) The final python script might stop updating after some time - I don’t know why. Maybe because the computer went to sleep or was inactive. For this I’ve created the “Update Manual”-Option. However, haven't really tested this because of the bug above. (However, after letting it run for about a day now it seems that everything went fine after opening from sleep)

3.) Py2app build doesn’t work without Alias Mode. App just terminates and gives this error.

<center>![](https://img1.steemit.com/400x400/https://steemitimages.com/DQmc69Q9YqyDi4GfzJ4Ws4myE97pVZwcciYJzAuj7a4GJzK/image.png)</center>

After some google search it seems that other people got it too and it is currently not fixed. Not being able to run it in standalone mode means that either Console or Alias-mode works. However, only with Alias-mode the textbox below words. From the console - the input is put into the console and not the textbox.

<center>![](https://img1.steemit.com/400x400/https://steemitimages.com/DQmeEwWXr5Vi9gtmP4hxYDg4UK6VF9NpPxDV4wt8vxU9cAR/image.png)</center>

I would love to get feedback in general and feedback of more experienced devs regarding the bugs.

![](https://img1.steemit.com/1x1/https://steemitimages.com/DQmZ2W8GVNx3NWiCU2nKrNSQHL9dPfiKh5mNV7WSBihfWch/image.png)
That’s it for now. Hope you have a great day :) ![](https://img1.steemit.com/1x1/https://steemitimages.com/DQmZ2W8GVNx3NWiCU2nKrNSQHL9dPfiKh5mNV7WSBihfWch/image.png)
-Wolf![](https://img1.steemit.com/1x1/https://steemitimages.com/DQmZ2W8GVNx3NWiCU2nKrNSQHL9dPfiKh5mNV7WSBihfWch/image.png)![](https://img1.steemit.com/1x1/https://steemitimages.com/DQmZ2W8GVNx3NWiCU2nKrNSQHL9dPfiKh5mNV7WSBihfWch/image.png)![](https://img1.steemit.com/1x1/https://steemitimages.com/DQmZ2W8GVNx3NWiCU2nKrNSQHL9dPfiKh5mNV7WSBihfWch/image.png)
![](https://img1.steemit.com/1x1/https://steemitimages.com/DQmZ2W8GVNx3NWiCU2nKrNSQHL9dPfiKh5mNV7WSBihfWch/image.png)
![signature.jpg](https://steemitimages.com/DQmaC3drwTNsZBMkJUfT5tcS5tYwnyZTNyAdxopwzMWFVvv/signature.jpg)
![](https://img1.steemit.com/1x1/https://steemitimages.com/DQmZ2W8GVNx3NWiCU2nKrNSQHL9dPfiKh5mNV7WSBihfWch/image.png)![](https://img1.steemit.com/1x1/https://steemitimages.com/DQmZ2W8GVNx3NWiCU2nKrNSQHL9dPfiKh5mNV7WSBihfWch/image.png)
👍 , , , , , , , , , , , , , , , , ,