Skip to content
This repository was archived by the owner on Jan 1, 2025. It is now read-only.

Commit c25011f

Browse files
committed
Cleanup python scripts a bit
1 parent 8bf7b25 commit c25011f

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

Python/helper.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import bl2sdk
2+
import io
3+
from contextlib import redirect_stdout
4+
5+
def describe(something):
6+
f = io.StringIO()
7+
with redirect_stdout(f):
8+
help(something)
9+
return f.getvalue()
10+
11+
def describe_without_uobject(something):
12+
s = describe(something).split('\n')
13+
uo = describe(bl2sdk.UObject).split('\n')
14+
output = []
15+
for line in s:
16+
if line not in uo:
17+
output.append(line)
18+
print('\n'.join(output))

Python/init.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ def log(s):
77
bl2sdk.Log(s)
88
print = log
99

10-
import commander_wannabe
10+
import commander_wannabe
11+
import rando

Python/rando.py

+3
Original file line numberDiff line numberDiff line change
@@ -282,3 +282,6 @@ def randomize(who, seed = None):
282282
else:
283283
for package_name, hunter_skills in hunters.values():
284284
randomize_hunter(package_name, hunter_skills, skill_mapping, rng)
285+
286+
print("[Randomizer] Initialized. Run `py randomize('<vault hunter>', <seed>)` to randomize. Leave seed blank for a random seed.")
287+
print("[Randomizer] Warning: Running `randomize` at any time other than your first time on the main menu may cause instability.")

0 commit comments

Comments
 (0)