All I can recall is that I used popen in the release manager and I think I needed to. It works and the machine turns off⌠thereâs not much more than that we need it to do and even if its not the pythonic way, the machine is turned off and it canât hurt anything⌠I think
I guess Iâm like a really bad duck hunter when it comes to programming. I shotgun in every direction until the duck gets tired of flying around and lands so I think I shot it.
I likely have a pull request ready to submit off of the main branch for just this button add. Do you think it wise to specify the shutdown specifically for the raspberry pi? We donât necessarily want windows to shut down with this or a mac to shut off with this. Windows would error because it is incorrect syntax and if you are using the program locally likely on a mac, push the button. I think permissions might be a bigger deal on std linux systems where the sudo user has to enter the password the first time sudo is run.
I know how to get the platform info, I donât know how to pass it to the html/js to turn the button on and off / block/hide/show or however that is done. The functionality is there, the show part of it isnât. Whoâs been doing all the feather css updates? Do they know how to do that?
Hereâs an example of the html code that is used to disable a button depending upon if enableHoley is true or false (itâs in the actions.html file):
Webcontrol uses jinja2 template language and duplicating this above (with mods) should work. But you could (I think) change the âdisabledâ to âdisplay:noneâ and it would hide the button altogether, which is preferred.
In WebpageProcessor, youâll see for the actions page that it already tests for whether the platform is an RPI or not, but what that is doing is actually testing it to see if its a docker container and I think its broken anyway. Since that button is getitng updated that uses the docker variable, Iâd go ahead and change that conditional statement to test for data.pyInstallPlatform instead and change docker to enableShutdown or something. Then in the render_template, change docker=docker to enableShutdown=enableShutdown. In the html file modify the code to use shutdownEnable (i.e., if using above as a guide, change enableHoley to enableShutdown)
good instructions. I found the docker variable and the data.py platform = RPI, so I put in an enableRPI variable next to docker so when/if docker ever goes completely away, this one wonât. The âdisplay:noneâ didnât work and neither did âdisplay:blockâ,
, but if I falsify the platform check, the button does disable:
After changing the flag a couple times, the button appears and disappears as it should. The last check is the password request failure. There isnât really any code in there for that. Iâll submit a pull request and you can check it out.
This is an experimental release with code from @orob. Please give it a shot. If youâre running 0.932, make sure you enable experimental releases to see it.