Commit graph

6 commits

Author SHA1 Message Date
Lukas Fleischer
8c99184f6d Use config and db in scripts
Instead of using configparser and mysql.connector directly, change all
Python scripts to use the config and db Python modules which are now
accessible from a common location.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:23 +02:00
Lukas Fleischer
603b5b5db9 Add a main() method to all Python scripts
Move the main program logic of all scripts to main() methods such that
they can be used as modules and easily be invoked by setuptools wrapper
scripts.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:06 +02:00
Lukas Fleischer
4c15f02ecb popupdate: Avoid NULL entries in the popularity field
The popularity field is declared as "NOT NULL" in the database schema.
Fix the popularity update query such that it uses a popularity of 0.0
instead of NULL for packages with no votes.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-03-01 18:27:23 +01:00
Lukas Fleischer
1e9cc370c2 popupdate: Drop unused variable
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-27 21:31:33 +02:00
Lukas Fleischer
824744f1d2 Add a field for package base popularity
Create a new field Popularity in the PackageBases table. The field is
updated by the popupdate script and reflects the popularity of a
package. Popularity is the sum of all votes with each vote being
weighted with a factor of 0.98 per day since its creation.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-11 18:59:52 +02:00
Lukas Fleischer
0345914c5c Add popupdate script
This adds a simple script that can be used to recalculate the number of
votes per package. It can be used in a cronjob.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-11 18:59:46 +02:00