project-alice-assistant / alicecli Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
I thought today that i'd test the Cli tool out and use it to wipe and reinstall alice. The below is my observations.
Missing key **False** in provided yaml file.
[Initializer] Config file already existing and user not wanting to rewrite, aborting
[Project Alice] Starting Alice main unit
[SkillManager] Skill "Telemetry" does not comply to "activeManager" condition, required "['TelemetryManager']"
[Initializer] Starting Project Alice initialization
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libxslt1-dev' instead of 'libxslt-dev'
and all the other version checks
I tested the above steps three times. same deal every time i tried.
PyInquirer requires a pretty out of date version of prompt-toolkit (1.0.14, current version is 3.0.24), which has a broken import statement in Python 3.10.
The file prompt_toolkit/styles/from_dict.py includes the line from collections import Mapping
which needs to be updated to from collections.abc import Mapping
.
Psycho suggested swapping out another compatible library: possibly https://github.com/magmax/python-inquirer. I'll try it and see how it goes.
Just had a look into discover()
, because AliceCLI did not display any devices for me.
I found
a) socket.gethostbyname(socket.gethostname())
just reverses-lookup my hostname, resulting in 127.0.1.1
, a loopback address.
b) AliceCLI then just assumes this is a '/24' net (it is not!) and pings 254 times the (local) machine. All these IPs are pingable, and therefore end up in devices
.
c) A "potential device" must have "projectalice" or "raspberrypi" inside name.
d) There is a .home
replacement hack in the code.
There are a couple of suggestions to improve here :)
a)
ip a
or hostname -I
. These depend very much on the underlying OS, but so does the current approach with ping
(there is also a switch between Windows and the rest).b)
c)
d)
.thehacker.local
at home ๐ - not sure, whether you should keep this special case.I have seen, there is the option to explicitly list all device, not just the potential ones, by alice discover -a
. As also the --network
option. I get good results, if I use them both. However all the data is displayed twice (on top with IP and hostname, then below in the menu only with IP adress), so it's hard to read. โ What about putting both (IP and name) into the menu?
Looking forward to feedback on my finding and suggestions. I would be happy to code something and create a PR, but makes sense only, if you like my direction. ๐
I'm trying to use AliceCLI to prepare an SDCard but getting an error when i select it:
Project Alice CLI version 1.2.1
? Prepare your SD card
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\abcabc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts\alice.exe\__main__.py", line 7, in <module>
File "C:\Users\abcabc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "C:\Users\abcabc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 1053, in main
rv = self.invoke(ctx)
File "C:\Users\abcabc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 1637, in invoke
super().invoke(ctx)
File "C:\Users\abcabc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\abcabc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "C:\Users\abcabc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "C:\Users\abcabc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\AliceCli\AliceCli.py", line 34, in cli
ctx.invoke(MainMenu.mainMenu)
File "C:\Users\abcabc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "C:\Users\abcabc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "C:\Users\abcabc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\AliceCli\MainMenu.py", line 107, in mainMenu
action()
File "C:\Users\abcabc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\AliceCli\MainMenu.py", line 79, in <lambda>
Choice(lambda: ctx.invoke(prepareSdCard), name='Prepare your SD card'),
File "C:\Users\abcabc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "C:\Users\abcabc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "C:\Users\abcabc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\AliceCli\install\install.py", line 400, in prepareSdCard
flasherAvailable = Path(balenaExecutablePath).exists()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\lib\pathlib.py", line 958, in __new__
self = cls._from_parts(args)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\lib\pathlib.py", line 592, in _from_parts
drv, root, parts = self._parse_args(args)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\lib\pathlib.py", line 576, in _parse_args
a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
Just in case it's something you need to know ? I got the below install errors while trying to update to the latest CLI. feel free to close the issue if it's not something you want to account for :)
larry@larrys-linux:
$ pip3.8 uninstall projectalice-cli$ pip3.8 install projectalice-cli
Found existing installation: projectalice-cli 0.1.3
Uninstalling projectalice-cli-0.1.3:
Would remove:
/home/larry/.local/bin/alice
/home/larry/.local/lib/python3.8/site-packages/AliceCli/*
/home/larry/.local/lib/python3.8/site-packages/projectalice_cli-0.1.3.dist-info/*
Proceed (Y/n)? y
Successfully uninstalled projectalice-cli-0.1.3
larry@larrys-linux:
Defaulting to user installation because normal site-packages is not writeable
Collecting projectalice-cli
Downloading projectalice_cli-1.1.0-py3-none-any.whl (44 kB)
|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 44 kB 405 kB/s
Collecting coverage~=6.2
Downloading coverage-6.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (217 kB)
|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 217 kB 17 kB/s
Collecting beautifulsoup4~=4.10.0
Downloading beautifulsoup4-4.10.0-py3-none-any.whl (97 kB)
|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 97 kB 68 kB/s
Collecting requests~=2.26.0
Downloading requests-2.26.0-py2.py3-none-any.whl (62 kB)
|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 62 kB 40 kB/s
Collecting InquirerPy~=0.3.1
Downloading InquirerPy-0.3.1-py3-none-any.whl (66 kB)
|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 66 kB 39 kB/s
Collecting click~=8.0.3
Downloading click-8.0.3-py3-none-any.whl (97 kB)
|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 97 kB 42 kB/s
Collecting paramiko~=2.8.1
Downloading paramiko-2.8.1-py2.py3-none-any.whl (206 kB)
|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 206 kB 20 kB/s
Collecting tqdm~=4.62.3
Downloading tqdm-4.62.3-py2.py3-none-any.whl (76 kB)
|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 76 kB 20 kB/s
Collecting pytest-cov~=3.0.0
Downloading pytest_cov-3.0.0-py3-none-any.whl (20 kB)
Requirement already satisfied: networkscan~=1.0.9 in ./.local/lib/python3.8/site-packages (from projectalice-cli) (1.0.9)
Requirement already satisfied: psutil~=5.8.0 in ./.local/lib/python3.8/site-packages (from projectalice-cli) (5.8.0)
Collecting pytest~=6.2.5
Downloading pytest-6.2.5-py3-none-any.whl (280 kB)
|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 280 kB 18 kB/s
Collecting pyyaml~=6.0
Downloading PyYAML-6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (701 kB)
|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 701 kB 20 kB/s
Collecting coveralls~=3.3.1
Downloading coveralls-3.3.1-py2.py3-none-any.whl (14 kB)
Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.8/dist-packages (from beautifulsoup4~=4.10.0->projectalice-cli) (2.0.1)
Requirement already satisfied: docopt>=0.6.1 in /usr/local/lib/python3.8/dist-packages (from coveralls~=3.3.1->projectalice-cli) (0.6.2)
Collecting pfzy<0.4.0,>=0.3.1
Downloading pfzy-0.3.3-py3-none-any.whl (8.5 kB)
Collecting prompt-toolkit<4.0.0,>=3.0.1
Downloading prompt_toolkit-3.0.24-py3-none-any.whl (374 kB)
|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 374 kB 25 kB/s
Requirement already satisfied: bcrypt>=3.1.3 in /usr/lib/python3/dist-packages (from paramiko~=2.8.1->projectalice-cli) (3.1.7)
Requirement already satisfied: cryptography>=2.5 in /usr/lib/python3/dist-packages (from paramiko~=2.8.1->projectalice-cli) (2.8)
Requirement already satisfied: pynacl>=1.0.1 in /usr/lib/python3/dist-packages (from paramiko~=2.8.1->projectalice-cli) (1.3.0)
Requirement already satisfied: toml in /usr/local/lib/python3.8/dist-packages (from pytest~=6.2.5->projectalice-cli) (0.10.1)
Requirement already satisfied: iniconfig in /usr/local/lib/python3.8/dist-packages (from pytest~=6.2.5->projectalice-cli) (1.1.1)
Requirement already satisfied: packaging in /usr/local/lib/python3.8/dist-packages (from pytest~=6.2.5->projectalice-cli) (20.4)
Requirement already satisfied: py>=1.8.2 in /usr/local/lib/python3.8/dist-packages (from pytest~=6.2.5->projectalice-cli) (1.9.0)
Requirement already satisfied: pluggy<2.0,>=0.12 in /usr/local/lib/python3.8/dist-packages (from pytest~=6.2.5->projectalice-cli) (0.13.1)
Requirement already satisfied: attrs>=19.2.0 in /usr/local/lib/python3.8/dist-packages (from pytest~=6.2.5->projectalice-cli) (20.2.0)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests~=2.26.0->projectalice-cli) (2.8)
Collecting charset-normalizer~=2.0.0
Downloading charset_normalizer-2.0.10-py3-none-any.whl (39 kB)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests~=2.26.0->projectalice-cli) (2019.11.28)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./.local/lib/python3.8/site-packages (from requests~=2.26.0->projectalice-cli) (1.25.10)
Collecting tomli
Downloading tomli-2.0.0-py3-none-any.whl (12 kB)
Requirement already satisfied: wcwidth in /usr/local/lib/python3.8/dist-packages (from prompt-toolkit<4.0.0,>=3.0.1->InquirerPy~=0.3.1->projectalice-cli) (0.2.5)
Requirement already satisfied: six in ./.local/lib/python3.8/site-packages (from packaging->pytest~=6.2.5->projectalice-cli) (1.14.0)
Requirement already satisfied: pyparsing>=2.0.2 in /usr/local/lib/python3.8/dist-packages (from packaging->pytest~=6.2.5->projectalice-cli) (2.4.7)
Installing collected packages: tomli, coverage, charset-normalizer, requests, pytest, prompt-toolkit, pfzy, tqdm, pyyaml, pytest-cov, paramiko, InquirerPy, coveralls, click, beautifulsoup4, projectalice-cli
Attempting uninstall: requests
Found existing installation: requests 2.24.0
Uninstalling requests-2.24.0:
Successfully uninstalled requests-2.24.0
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
pyinquirer 1.0.3 requires prompt-toolkit==1.0.14, but you have prompt-toolkit 3.0.24 which is incompatible.
projectalice-sk 1.9.5 requires coverage~=4.5.4, but you have coverage 6.2 which is incompatible.
projectalice-sk 1.9.5 requires coveralls~=1.8.2, but you have coveralls 3.3.1 which is incompatible.
projectalice-sk 1.9.5 requires prompt-toolkit==1.0.14, but you have prompt-toolkit 3.0.24 which is incompatible.
projectalice-sk 1.9.5 requires pytest~=5.2.2, but you have pytest 6.2.5 which is incompatible.
projectalice-sk 1.9.5 requires pytest-cov~=2.8.1, but you have pytest-cov 3.0.0 which is incompatible.
mediawikiapi 1.1.5 requires beautifulsoup4==4.9.1, but you have beautifulsoup4 4.10.0 which is incompatible.
Successfully installed InquirerPy-0.3.1 beautifulsoup4-4.10.0 charset-normalizer-2.0.10 click-8.0.3 coverage-6.2 coveralls-3.3.1 paramiko-2.8.1 pfzy-0.3.3 projectalice-cli-1.1.0 prompt-toolkit-3.0.24 pytest-6.2.5 pytest-cov-3.0.0 pyyaml-6.0 requests-2.26.0 tomli-2.0.0 tqdm-4.62.3
larry@larrys-linux:~$
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.