Skip to content

Commit

Permalink
Merge pull request #1961 from overcuriousity/main
Browse files Browse the repository at this point in the history
fix bad linux filename generation
  • Loading branch information
soxoj authored Dec 12, 2024
2 parents 1ed0c61 + b8c62f9 commit b2283a5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions maigret/maigret.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
import sys
import platform
import re
from argparse import ArgumentParser, RawDescriptionHelpFormatter
from typing import List, Tuple
import os.path as path
Expand Down Expand Up @@ -679,25 +680,30 @@ async def main():
# TODO: tests
if recursive_search_enabled:
extracted_ids = extract_ids_from_results(results, db)
query_notify.warning(f'Extracted IDs: {extracted_ids}')
usernames.update(extracted_ids)

# reporting for a one username
if args.xmind:
username = username.replace('/', '_')
filename = report_filepath_tpl.format(username=username, postfix='.xmind')
save_xmind_report(filename, username, results)
query_notify.warning(f'XMind report for {username} saved in {filename}')

if args.csv:
username = username.replace('/', '_')
filename = report_filepath_tpl.format(username=username, postfix='.csv')
save_csv_report(filename, username, results)
query_notify.warning(f'CSV report for {username} saved in {filename}')

if args.txt:
username = username.replace('/', '_')
filename = report_filepath_tpl.format(username=username, postfix='.txt')
save_txt_report(filename, username, results)
query_notify.warning(f'TXT report for {username} saved in {filename}')

if args.json:
username = username.replace('/', '_')
filename = report_filepath_tpl.format(
username=username, postfix=f'_{args.json}.json'
)
Expand All @@ -715,18 +721,21 @@ async def main():
username = report_context['username']

if args.html:
username = username.replace('/', '_')
filename = report_filepath_tpl.format(
username=username, postfix='_plain.html'
)
save_html_report(filename, report_context)
query_notify.warning(f'HTML report on all usernames saved in {filename}')

if args.pdf:
username = username.replace('/', '_')
filename = report_filepath_tpl.format(username=username, postfix='.pdf')
save_pdf_report(filename, report_context)
query_notify.warning(f'PDF report on all usernames saved in {filename}')

if args.graph:
username = username.replace('/', '_')
filename = report_filepath_tpl.format(
username=username, postfix='_graph.html'
)
Expand Down

0 comments on commit b2283a5

Please sign in to comment.