mirror of
https://github.com/norohind/SquadsActivityMonitor.git
synced 2025-04-12 13:00:02 +03:00
Remove obosolute documentation from code
This commit is contained in:
parent
bfd68f9afa
commit
a6fda1705e
22
main.py
22
main.py
@ -1,25 +1,3 @@
|
||||
"""
|
||||
Run by third side (i.e. cron)
|
||||
Request all or specified combination of platform + activity
|
||||
Write results to sqlite DB in journal like format
|
||||
|
||||
|
||||
AP - appropriate field from json
|
||||
DB structure
|
||||
states:
|
||||
action_id integer - id of insertion, all records from one request will have the same action_id
|
||||
leaderboard_type string - (AP)
|
||||
platform string - platform of data
|
||||
squadron_id integer - (squadron field)
|
||||
score integer - (AP)
|
||||
percentile integer - (AP)
|
||||
rank integer - (AP)
|
||||
name string - (AP)
|
||||
tag string - (AP)
|
||||
timestamp - inserts by DB, default TIMESTAMP
|
||||
|
||||
"""
|
||||
|
||||
import requests
|
||||
from model import model
|
||||
# from EDMCLogging import get_main_logger
|
||||
|
56
utils.py
56
utils.py
@ -30,9 +30,6 @@ except FileNotFoundError:
|
||||
|
||||
# ofc I could do it without enums, I just wanted to try them
|
||||
class Platform(enum.Enum):
|
||||
"""
|
||||
Enumeration for platforms
|
||||
"""
|
||||
PC = 'PC'
|
||||
PS4 = 'PS4'
|
||||
XBOX = 'XBOX'
|
||||
@ -162,56 +159,3 @@ def measure(function: callable, name_to_display: str):
|
||||
return result
|
||||
|
||||
return decorated
|
||||
|
||||
|
||||
activity_table_html_template = """<!DOCTYPE HTML>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<script src="/js/json2htmltable.js"></script>
|
||||
<script type="text/javascript">
|
||||
window.addEventListener("load", () => {
|
||||
document.getElementById('table0div').appendChild(buildHtmlTable({items})); // build table
|
||||
|
||||
var table = document.querySelector("#table0div > table")
|
||||
var header = table.rows[0]
|
||||
|
||||
for (var i = 0, cell; cell = header.cells[i]; i++){
|
||||
if (cell.innerText.includes('{target_column_name}')){
|
||||
var target_column_id = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (target_column_id == null) { // don't to anything if no action_id in the table
|
||||
return;
|
||||
}
|
||||
|
||||
for (var i = 1, row; row = table.rows[i]; i++) { // append to target column filed href
|
||||
row.cells[target_column_id].innerHTML = '<td><a href="{link}">{original_value}</a></td>'.replace('{link}', '{target_new_url}' + table.rows[i].cells[target_column_id].innerText).replace('{original_value}', table.rows[i].cells[target_column_id].innerText);
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<link type="text/css" rel="stylesheet" href="/js/table_styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="table0div">
|
||||
</div>
|
||||
<div id=footer0div>
|
||||
<footer>
|
||||
<a href="/">Main page</a>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>"""
|
||||
|
||||
index_template = """
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<p>{body}</p>
|
||||
</body>
|
||||
</html>"""[1:]
|
||||
|
Loading…
x
Reference in New Issue
Block a user