X7ROOT File Manager
Current Path:
/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/lib
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
lvestats
/
lib
/
ðŸ“
..
📄
__init__.py
(219 B)
ðŸ“
__pycache__
ðŸ“
bursting
ðŸ“
chart
📄
cloudlinux_statistics.py
(24.87 KB)
📄
cloudlinux_statsnotifier.py
(5.09 KB)
ðŸ“
commons
📄
config.py
(3.2 KB)
📄
db_functions.py
(1.45 KB)
📄
dbengine.py
(10.57 KB)
ðŸ“
info
📄
jsonhandler.py
(443 B)
📄
lve_create_db.py
(1.88 KB)
📄
lve_list.py
(3.35 KB)
📄
lveinfolib.py
(41.82 KB)
📄
lveinfolib_gov.py
(13.56 KB)
📄
lvestats_server.py
(8.46 KB)
📄
notifications_helper.py
(5.41 KB)
ðŸ“
parsers
📄
server_id.py
(5.14 KB)
📄
snapshot.py
(7.42 KB)
📄
uidconverter.py
(5.01 KB)
📄
ustate.py
(8.62 KB)
Editing: db_functions.py
# coding=utf-8 # # Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENSE.TXT from sqlalchemy.ext.compiler import compiles from sqlalchemy.sql import expression from sqlalchemy.types import Numeric class greatest(expression.FunctionElement): type = Numeric() name = "greatest" class least(expression.FunctionElement): type = Numeric() name = "least" @compiles(greatest) def default_greatest(element, compiler, **kw): return compiler.visit_function(element) @compiles(least) def default_least(element, compiler, **kw): return compiler.visit_function(element) @compiles(greatest, "sqlite") def case_greatest(element, compiler, **kw): arg1, arg2 = list(element.clauses) return f"max({compiler.process(arg1)}, {compiler.process(arg2)})" @compiles(least, "sqlite") def case_least(element, compiler, **kw): arg1, arg2 = list(element.clauses) return f"min({compiler.process(arg1)}, {compiler.process(arg2)})" class div(expression.FunctionElement): type = Numeric name = "div" @compiles(div) def default_div(element, compiler, **kw): arg1, arg2 = list(element.clauses) return f"{compiler.process(arg1)} / {compiler.process(arg2)}" @compiles(div, "mysql") def case_div(element, compiler, **kw): arg1, arg2 = list(element.clauses) return f"{compiler.process(arg1)} div {compiler.process(arg2)}"
Upload File
Create Folder