I'm trying to add progressbar to my install script. I tried to use the module progressbar but it depends on range and I don't have this number, also every file that I want to install takes a different time. I have a list of the files that I want to install and I want to monitor it by progressbar. This is the process line:
p2 = subprocess.Popen(["dpkg", "--force-all", "-i", "-R", pwd.strip() + "/archives"], stdout=out, stderr=err)
I thought to work with the output file, but It grows dynamically and I didn't succeed monitor it. An example for the out file:
In the beginning of the file, there is line of "Unpacking" and line of "Preparing" for each package:
Unpacking openvswitch-switch (2.0.2-0ubuntu0.14.04.2) over (2.0.2-0ubuntu0.14.04.2) ...
Preparing to unpack .../libllvm3.6_3.6-2ubuntu1_amd64.deb ...
Unpacking libllvm3.6:amd64 (1:3.6-2ubuntu1) over (1:3.6-2ubuntu1) ...
Preparing to unpack .../kpartx_0.4.9-3ubuntu7.4_amd64.deb ...
Unpacking kpartx (0.4.9-3ubuntu7.4) over (0.4.9-3ubuntu7.4) ...
.
.
.
And after that there are lines of "Setting up" and sometimes starting the process of the package, like this:
Setting up openvswitch-switch (2.0.2-0ubuntu0.14.04.2) ...
openvswitch-switch stop/waiting
openvswitch-switch start/running
Setting up libllvm3.6:amd64 (1:3.6-2ubuntu1) ...
Setting up libxen-4.4 (4.4.2-0ubuntu0.14.04.1) ...
Setting up sg3-utils (1.36-1ubuntu1) ...
.
.
.
I have 294 files and the numbers of lines that include 'Unpacking' 294, 'Preparing' 294 and 'Setting up' 293 and the total number of lines is 915.
Anyone have an idea how to do this?
\bspaces and=to draw and update a line like========> 20%. Once that's specified, remaining should be easier...