-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented TerminalCommand and a update mechanism. #369
Implemented TerminalCommand and a update mechanism. #369
Conversation
6c2cc70
to
05f1b6e
Compare
552570d
to
e697351
Compare
+ TerminalCommand in terminal.py - runs trusted and untrusted(ConfirmAction for safety) CMD/terminal commands + DependencyCheck - checks of dragonfly's up-to-date. + internetcheck - checks Casters network connection via cloudfire DNS + online_mode in settings.py - toggles features that require a network connection ToDo + Document Features
e697351
to
d3234b6
Compare
I've done some testing with this. At first the pip commands didn't work properly for me because 'pip' was using Python 3.5 instead. They worked correctly after I fixed that by adjusting the Windows PATH variable. Unfortunately if the pip commands fail, Dragon will still be restarted. Perhaps the "update X" commands should use a I tried doing that and discovered a bug in Caster's I can fix these things in this PR if you like :-) I reckon dragonfly's |
Thank you for testing. I wondered how it would work with side by side versions of python depending on the path. I'll see if I can figure out some sort of clever way to handle that. It will involve checking the python version number and name that uses for execution (py, py2, python and so on). I agree that it should only return code of 0 for now. Oh I could have swore I thought I fixed that issue by adding the synchronous parameter on the class level defaulting to false. Edit: This is what I thought fix the issue but apparently not. :/ I appreciate that, feel free to make any changes to the pull request. I wish GitHub made that easier for co-contributors. |
For now we could put this in the settings.py. # python settings
"python": {
"automatic_settings": True, # Set to false to manually set "version" and "pip" below.
"version": "python", # Depending Python setup (python, python2, python2.7, py, py -2)
"pip": "pip" # Depending on PIP setup (pip, pip2, pip2.7)
}, I'll see if I can come up of the function that illiterate through until a valid setting is found for 2.7. unless This way we don't have to have specific setup instructions for python which can vary based on default path, Python install method, and 2.X and 3.X congruent. Ideally I wouldn't want somebody to have to change there Python set up especially if they're already a Python developer. Usually a lot of other software that have settings that need to be adjusted as well in that case. |
I think instead of having a setting for it, the absolute path to 'Python27\scripts\pip.exe' could be retrieved from Yep, that allows the synchronous parameter to be specified for RunCommand.__init__(self, command, process_command, synchronous) I can add the PATH checking too if you want. I noticed that |
Sounds like a plan :) |
- Pass missing arguments to RunCommand.__init__ from the TerminalCommand class. - Use the pip.exe script for Python 2.7 directly by parsing the Windows PATH variable, falling back on pip.exe if the file isn't in the usual place. - Stop Caster's update commands from restarting if the commands fail. - Update minimum required dragonfly2 version to 0.11.1.
I've added the changes I mentioned. Sorry it took me a while. |
This pull request implements the following
ToDo
A big thanks to @Danesprite for contributing code towards TerminalCommand and implementing RunCommand in Dragonfly that makes this Pull request possible.