-
Notifications
You must be signed in to change notification settings - Fork 3
/
getrecord.py
41 lines (36 loc) · 1.24 KB
/
getrecord.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/python
#
# retrieve specified record from lib
#
import sys
import olypy.oio as oio
from olypy.oid import to_oid, to_int
import olypy.dbck as dbck
import pathlib
from jinja2 import Environment, PackageLoader, select_autoescape
from olymap.loc import build_complete_loc_dict
from olymap.ship import build_complete_ship_dict
from olymap.char import build_complete_char_dict
from olymap.item import build_complete_item_dict
from olymap.skill import build_complete_skill_dict
from olymap.storm import build_complete_storm_dict
from olymap.player import build_complete_player_dict
import olymap.utilities as u
import olymap.reports as reports
from olymap.maps import write_index, write_map_leaves, write_top_map, write_bitmap
from olymap.legacy import create_map_matrix, write_legacy_bitmap, write_legacy_top_map, write_legacy_map_leaves
inlib = sys.argv[1]
data = oio.read_lib(inlib)
dbck.check_db(data, fix=True, checknames=True)
rec_id = ' '
rec_id = input('Enter record id ("0" to exit): ')
while rec_id != '0':
try:
rec_id_conv = to_int(rec_id)
try:
print(data[rec_id_conv])
except:
print('Invalid key')
except:
print('Invalid key')
rec_id = input('Enter record id ("0" to exit): ')