#						-*- Org -*-
* DONE Run external commands
CLOSED: [2020-08-20 Thu 18:13]
https://cmdlinetips.com/2014/03/how-to-run-a-shell-command-from-python-and-get-the-output/

* DONE ~configparser~
CLOSED: [2020-08-20 Thu 18:13]
Parses ini files. Useful for parsing the output of ~qpkg_cli~.

* TODO Service class
~service.py~ has a bunch of subclasses of ~Service~, for various platforms.

It should be possible to define a ~QNAPService~ class that extends ~Service~. Try something like that for QNAP.

Use
    - ~qpkg_cli --enable <name>~
    - ~qpkg_cli --disable <name>~
    - ~qpkg_cli --start <name>~
    - ~qpkg_cli --stop <name>~

* CANCELLED Integrate with ~package~ module
CLOSED: [2020-08-20 Thu 18:13]
See ~/usr/lib/python2.7/dist-packages/ansible//modules/packaging/os/package_facts.py~ for a few examples. ~PKG~ and ~PORTAGE~ are defined, AIUI, as CLI-based package managers. ~qpkg_cli~ should do the same.

* TODO Allow installing ~.qpkg~ files
https://www.qnap.com/en/how-to/knowledge-base/article/how-to-install-qnap-applications-qpkg-files-manually/

I guess the ~url~ parameter can be used for this. Or add a ~file~ parameter. Or whatever other Ansible modules use.

* TODO Bug: Error checking queue
Occasionally, ~qpkg_cli -s <pkg>~ prints
: [CLI] recv error, code = -1
Maybe high load has to do with it. Observed this with

: > uptime
:  08:23:46 up  7:52,  load average: 9.10, 10.87, 11.08

* qpkg_job.conf
~/etc/config/qpkg_job.conf~ right after running
: qpkg_cli -a phpMyAdmin
: qpkg_cli -a perl

#+BEGIN_SRC conf-windows
[phpMyAdmin]
install_status = 99
Install_Percentage = 0
download_status = 2
display_name = phpMyAdmin
internal_name = phpMyAdmin
stcode = 3
opcode = 0
policy = 1
priority = 0
sub_option = 0
download_percentage = 
is_update = 0
filepath = 
unzip_filepath = 
url = https://download.qnap.com/QPKG/phpMyAdmin_4.9.1.0.zip
type = 0
class = 
store = 
category = Partners
version = 4.9.1
destpath = 
mtime = 947137
pid = 16662

[perl]
display_name = 
internal_name = perl
stcode = 6
opcode = 0
policy = 0
priority = 0
sub_option = 0
download_percentage = 
install_status = -1
Install_Percentage = 0
download_status = -1
is_update = 0
filepath = 
unzip_filepath = 
url = 
type = 0
class = 
store = 
category = 
version = 
destpath = 
mtime = 947139
#+END_SRC
