Mercurial > p > roundup > code
annotate scripts/dump_dbm_sessions_db.py @ 6763:d93b441ee778
Handle build issues, update css for mobile
I added www.roundup-tracker.org as a property of mine in google search
console. It reports bad mobile experience.
According to the goatcounter tracker I put in, we get 400 hits from
phones/small tablets; 400 from tablets/small laptops and 800 from
computer screens. So 1/4 is mobile and 1/2 is not a large computer
screen.
On mobile (<960px) the left hand menu is stacked on top of the column
in mobile sizes. Sub-menu links are spaced apart to make them easier
to clkick on with a finger. Same with the table of contents in the
documents. The main document content is now full display width (rather
than scrunched to the right side of the display). This is just a quick
hack, but it should make the docs more usable.
As I worked, I found that _static/style.css changes were not being
copied into the html build directory when sphinx was rerun. Nuke
entire html subdir and rebuild from scratch each time. Also added
comments to Makefile.
Also robots.txt was being added as extra_html by sphinx, but it causes
a missing from TOC error that exits the build (when using -W). Since
exiting on warning is better, I changed Makefile to add
robots.txt. Removed robots.txt references from conf.py.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 10 Jul 2022 18:16:13 -0400 |
| parents | 61481d7bbb07 |
| children | 1188bb423f92 |
| rev | line source |
|---|---|
|
6571
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
1 #! /usr/bin/env python3 |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
2 """Usage: dump_dbm_sessions_db.py [filename] |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
3 |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
4 Simple script to dump the otks and sessions dbm databases. Dumps |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
5 sessions db in current directory if no argument is given. |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
6 |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
7 Dump format: |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
8 |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
9 key: <timestamp> data |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
10 |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
11 where <timestamp> is the human readable __timestamp decoded from the |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
12 data object. |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
13 |
| 6577 | 14 """ |
|
6571
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
15 |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
16 import dbm, marshal, sys |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
17 from datetime import datetime |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
18 |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
19 try: |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
20 file = sys.argv[1] |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
21 except IndexError: |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
22 file="sessions" |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
23 |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
24 try: |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
25 db = dbm.open(file) |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
26 except Exception: |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
27 print("Unable to open database: %s"%file) |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
28 exit(1) |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
29 |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
30 k = db.firstkey() |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
31 while k is not None: |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
32 d = marshal.loads(db[k]) |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
33 t = datetime.fromtimestamp(d['__timestamp']) |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
34 print("%s: %s %s"%(k, t, d)) |
|
cd408eb748dd
Add small utility script for dumping dbm based databases.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
35 k = db.nextkey(k) |
