mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
housekeep: define filters in their own modules
This patch cleans up aurweb.templates and removes direct module-level initialization of the environment. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
fca175ed84
commit
211ca5e49c
16 changed files with 159 additions and 159 deletions
|
@ -8,8 +8,9 @@ from sqlalchemy import and_, literal, orm
|
|||
|
||||
import aurweb.config as config
|
||||
|
||||
from aurweb import db, defaults, models, util
|
||||
from aurweb import db, defaults, models
|
||||
from aurweb.exceptions import RPCError
|
||||
from aurweb.filters import number_format
|
||||
from aurweb.packages.search import RPCSearch
|
||||
|
||||
TYPE_MAPPING = {
|
||||
|
@ -124,7 +125,7 @@ class RPC:
|
|||
# Produce RPC API compatible Popularity: If zero, it's an integer
|
||||
# 0, otherwise, it's formatted to the 6th decimal place.
|
||||
pop = package.Popularity
|
||||
pop = 0 if not pop else float(util.number_format(pop, 6))
|
||||
pop = 0 if not pop else float(number_format(pop, 6))
|
||||
|
||||
snapshot_uri = config.get("options", "snapshot_uri")
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue