Codebase list battery-stats / 82fd698
Add patch to migrate to Python 3. (Closes: #936187) Aurélien COUDERC 4 years ago
5 changed file(s) with 47 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
00 battery-stats (0.5.6-2) UNRELEASED; urgency=medium
11
2 [ Ondřej Nový ]
23 * d/control: Remove ancient X-Python-Version field
34 * d/control: Deprecating priority extra as per policy 4.0.1
45 * d/changelog: Remove trailing whitespaces
56 * d/control: Remove trailing whitespaces
67 * d/control: Set Vcs-* to salsa.debian.org
8
9 [ Aurélien COUDERC ]
10 * Add patch to migrate to Python 3. (Closes: #936187)
711
812 -- Ondřej Nový <onovy@debian.org> Mon, 01 Oct 2018 09:56:14 +0200
913
44 Build-Depends:
55 debhelper (>= 9),
66 cmake,
7 python | python-all | python-dev | python-all-dev,
8 dh-python,
97 gnuplot-nox (>= 4) | gnuplot-qt,
10 python-matplotlib,
118 libtext-csv-perl,
129 imagemagick
1310 Standards-Version: 3.9.8
2017 Depends: ${shlibs:Depends}, ${misc:Depends},
2118 logrotate,
2219 gzip (>= 1.3.2)
23 Recommends: ${python:Depends},
24 python,
25 python-matplotlib,
20 Recommends: python3,
21 python3-matplotlib,
2622 libtext-csv-perl,
2723 gnuplot (>= 4.0.0)
2824 Description: collects statistics about charge of laptop batteries
0 --- a/src/battery-stats-generate
1 +++ b/src/battery-stats-generate
2 @@ -1,4 +1,4 @@
3 -#!/usr/bin/python
4 +#!/usr/bin/python3
5
6 import argparse
7 import itertools
8 @@ -32,11 +32,11 @@
9 print(','.join(fields))
10 # remove or add between 0 and 10% of the charge, half the time
11 energy_now += change_charge(args.discharge_prob,
12 - factor=random.randint(0, energy_full/args.discharge_rate))
13 + factor=random.randint(0, int(energy_full/args.discharge_rate)))
14
15 # around one out of 3 changes to remove around 0.1% of charge
16 energy_full -= change_charge(args.damage_prob, mult = 0,
17 - factor=random.randint(0, energy_full/args.damage_rate))
18 + factor=random.randint(0, int(energy_full/args.damage_rate)))
19 now += args.wait
20 if not i:
21 break
22 --- a/src/battery-stats-graph
23 +++ b/src/battery-stats-graph
24 @@ -1,4 +1,4 @@
25 -#!/usr/bin/python
26 +#!/usr/bin/python3
27 # -*- coding: utf-8 -*-
28 #
29 # This file is part of the battery-stats package.
30 @@ -87,7 +87,7 @@
31 except csv.Error as e:
32 logging.warning('CSV file is corrupt, skipping remaining entries: %s', e)
33 logging.debug('building data array')
34 - return np.array(data, dtype=zip(fields, 'f'*len(fields)))
35 + return np.array(data, dtype=list(zip(fields, 'f'*len(fields))))
36
37 # the builtin CSV parser above is faster, we went from 8 to 2 seconds
38 # on our test data here there are probably other ways of making this
0 fix-python3-compatibility
00 #!/usr/bin/make -f
11
22 %:
3 dh $@ --with python2
3 dh $@