-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Globals.py
executable file
·148 lines (137 loc) · 5.16 KB
/
Globals.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Author: Jeremy Parks
Purpose: Globals
Note: Requires Python 3.7.x
'''
import threading
import math
from collections import defaultdict
from copy import deepcopy
from xpgain_lookup import table
TLcache = threading.local()
def init():
# Hold our 5 most popular renown heart karma items for cooking
global karmin
karmin = {}
global TLcache
TLcache = threading.local()
def xpreq(level):
if level > 400:
level = 400
tmp = 500
for _i in range(1,level):
tmp = math.floor(tmp * 1.01)
return tmp
# replacement for deepcopy for dictionary as the default is overkill(slow)
def mydeepcopy(indict):
# ret = deepcopy(indict)
# return ret
if isinstance(indict, type(None)):
return None
ret = {}
for k, v in indict.items():
if type(v) in [dict, defaultdict]:
ret[k] = mydeepcopy(v)
elif type(v) is set:
ret[k] = v.copy()
# not a dict or set
else:
try:
ret[k] = v[:]
# not a list, string, or tuple
# should be a simple type(eg int/float)
except TypeError:
ret[k] = v
return ret
# Nav bar
# path, home, nGuides, fGuides, special, cooking, nHearts, tHearts, aHearts, jc, art, hunt, wc, ac, lw, tailor, scribe, totals, about, lang, current page, free?
header = """<nav>
<ul>
<li><a href="/{22}{0}">{1}</a></li>
<li><a href="#">{2}</a>
<ul>
<li><a href="#">{5}</a>
<ul>
<li><a href="/{22}{0}cooking.html">{6}</a></li>
<li><a href="/{22}{0}cooking_karma_light.html">{7}</a></li>
<li><a href="/{22}{0}cooking_karma.html">{8}</a></li>
</ul>
</li>
<li><a href="/{22}{0}jewelcraft.html">{9}</a></li>
<li><a href="/{22}{0}artificing.html">{10}</a></li>
<li><a href="/{22}{0}huntsman.html">{11}</a></li>
<li><a href="/{22}{0}weaponcraft.html">{12}</a></li>
<li><a href="/{22}{0}armorcraft.html">{13}</a></li>
<li><a href="/{22}{0}leatherworking.html">{14}</a></li>
<li><a href="/{22}{0}tailor.html">{15}</a></li>
<li><a href="/{22}{0}scribe.html">{16}</a></li>
</ul>
</li>
<li><a href="#">{3}</a>
<ul>
<li><a href="#">{5}</a>
<ul>
<li><a href="/{22}{0}cooking_fast.html">{6}</a></li>
<li><a href="/{22}{0}cooking_karma_fast_light.html">{7}</a></li>
<li><a href="/{22}{0}cooking_karma_fast.html">{8}</a></li>
</ul>
</li>
<li><a href="/{22}{0}jewelcraft_fast.html">{9}</a></li>
<li><a href="/{22}{0}artificing_fast.html">{10}</a></li>
<li><a href="/{22}{0}huntsman_fast.html">{11}</a></li>
<li><a href="/{22}{0}weaponcraft_fast.html">{12}</a></li>
<li><a href="/{22}{0}armorcraft_fast.html">{13}</a></li>
<li><a href="/{22}{0}leatherworking_fast.html">{14}</a></li>
<li><a href="/{22}{0}tailor_fast.html">{15}</a></li>
</ul>
</li>
<li><a href="#">400-500</a>
<ul>
<li><a href="/{22}{0}artificing_400.html">{10}</a></li>
<li><a href="/{22}{0}huntsman_400.html">{11}</a></li>
<li><a href="/{22}{0}weaponcraft_400.html">{12}</a></li>
<li><a href="/{22}{0}armorcraft_400.html">{13}</a></li>
<li><a href="/{22}{0}leatherworking_400.html">{14}</a></li>
<li><a href="/{22}{0}tailor_400.html">{15}</a></li>
</ul>
</li>
<li><a href="#">{4}</a>
<ul>
<li><a href="#">{5} 1-200</a>
<ul>
<li><a href="/{22}{0}cooking_fast_200.html">{6}</a></li>
<li><a href="/{22}{0}cooking_karma_fast_200.html">{8}</a></li>
</ul>
</li>
<li><a href="#">400-450</a>
<ul>
<li><a href="/{22}{0}cooking_450.html">{6}</a></li>
<li><a href="/{22}{0}cooking_karma_450.html">{8}</a></li>
<li><a href="/{22}{0}artificing_450.html">{10}</a></li>
<li><a href="/{22}{0}huntsman_450.html">{11}</a></li>
<li><a href="/{22}{0}weaponcraft_450.html">{12}</a></li>
<li><a href="/{22}{0}armorcraft_450.html">{13}</a></li>
<li><a href="/{22}{0}leatherworking_450.html">{14}</a></li>
<li><a href="/{22}{0}tailor_450.html">{15}</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="/{22}{0}total.html">{17}</a></li>
<li><a href="/{22}{0}faq.html">{18}</a></li>
<li><a href="#" class="language" hreflang="{20}">{19}</a>
<ul>
<li><a href="/{22}{21}" hreflang="en">English</a></li>
<li><a href="/{22}fr/{21}" hreflang="fr">Français</a></li>
<li><a href="/{22}cz/{21}" hreflang="cz">Čeština</a></li>
<li><a href="/{22}de/{21}" hreflang="de">Deutsch</a></li>
<li><a href="/{22}es/{21}" hreflang="es">Español</a></li>
<li><a href="/{22}pt-br/{21}" hreflang="pt-BR">Português do Brasil</a></li>
<li><a href="/{22}zh/{21}" hreflang="zh">Chinese (Simplified)</a></li>
</ul>
</li>
</ul>
</nav>
"""