summaryrefslogtreecommitdiff
path: root/scripts/popupdate.py
AgeCommit message (Collapse)Author
2016-09-29scripts: Do not use UNIX_TIMESTAMPLukas Fleischer
Avoid using UNIX_TIMESTAMP which is not part of the SQL standard. See f2a6bd2 (git-interface: Do not use UNIX_TIMESTAMP, 2016-08-05) for related changes. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29Use config and db in scriptsLukas Fleischer
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-29Add a main() method to all Python scriptsLukas Fleischer
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-03-01popupdate: Avoid NULL entries in the popularity fieldLukas Fleischer
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>
2015-06-27popupdate: Drop unused variableLukas Fleischer
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-11Add a field for package base popularityLukas Fleischer
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-11Add popupdate scriptLukas Fleischer
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>