Open optimisticninja opened 2 months ago
class SolutionSpec(DNA):
# ...
def run(self, silent=False):
""" Generic cradle to run decryptions """
segment_num = 0
for num, text in zip(self.retrieval.nums, self.retrieval.retrieve()):
# if it's a new segment
if num != segment_num:
segment_num = num
if not silent:
# show the correct segment information
mode_name = self.retrieval.mode.__name__ # Get the attribute name of the mode
print(f"=== PAGE {segment_num} ({mode_name.upper()} {num}) ===")
else:
if not silent:
# If it's not a new segment, display the page information only
print(f"=== PAGE {num} ===")
if not silent and self.show_runes:
print(text)
print("-----")
if self.crypto.key:
plaintext = self.crypto.scheme(text,
key=self.crypto.key,
shift=self.crypto.shift,
lookup=self.crypto.lookup,
skips=self.crypto.skips,
excludes=self.crypto.excludes)
if not silent:
print(plaintext)
else:
self.plaintext = plaintext
else:
plaintext = self.crypto.scheme(text, lookup=self.crypto.lookup, shift=self.crypto.shift, skips=self.crypto.skips)
if not silent:
print(plaintext)
else:
self.plaintext = plaintext
# ...
This has a temporary fix in main now where i get the attribute name of the mode and insert it into a format string.
This has a temporary fix in main now where i get the attribute name of the mode and insert it into a format string.
What about now?
This has a temporary fix in main now where i get the attribute name of the mode and insert it into a format string.
What about now?
Yep, if you run main.py with no arguments you will see section 5 printed for pages 12 and 13. However, supplying --section
or --lines
doesn't print anything at the moment.
Currently, when operating over a segment that may include multiple pages, the header looks as follows: (this is for pages 12/13 which is actually operating over segment 5, not page 5).
This can be referenced in #3 as a means to display as page:segment:paragraph:sentence:word, etc.