Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
BorisTestov committed Jun 10, 2023
2 parents 1fd4af7 + 50c48ac commit 1630a14
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
10 changes: 5 additions & 5 deletions cli_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ def __init__(self, remove_after_find=False):
self.searcher.search_done.connect(lambda: self.finished.emit())

def print_output(self, result):
output = "\n\nDUPLICATES:\n"
output = ["\n\nDUPLICATES:\n"]
for key, value in result.items():
output += f"{key}"
output.append(f"\n{key}")
for v in value:
output += f"\t{v}"
output += "\n\n"
logging.info(output)
output.append(f"\n\t{v}")
output.append("\n\n")
logging.info(''.join(output))

def run(self, include_directories, exclude_directories, include_masks, exclude_masks, depth, min_file_size,
search_type):
Expand Down
2 changes: 1 addition & 1 deletion duplicate_finder.spec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ exe = EXE(
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
Expand Down
30 changes: 13 additions & 17 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,19 @@ def parse_arguments():
parser.add_argument('--remove-after-find', action='store_true', default=False,
help='Removes the file after it is found')

# args = None
# try:
# args = parser.parse_args()
# if hasattr(args, 'include_directories') and args.include_directories is not None:
# if not args.include_directories:
# parser.error("--include-directories requires at least one directory.")
# return args # Return args here
# except (argparse.ArgumentError, argparse.ArgumentTypeError) as e:
# print(str(e))
# parser.print_help()
# sys.exit(1)
# except Exception as e:
# print(str(e))
# parser.print_help()
# sys.exit(1)

return parser.parse_args()
try:
args = parser.parse_args()
if hasattr(args, 'include_directories') and args.include_directories is not None:
if not args.include_directories:
parser.error("--include-directories requires at least one directory.")
return args
except (argparse.ArgumentError, argparse.ArgumentTypeError) as e:
print(str(e), file=sys.stderr)
parser.print_help(sys.stderr)
except Exception as e:
print(str(e), file=sys.stderr)
parser.print_help(sys.stderr)
sys.exit(1)


def handle_gui_run():
Expand Down

0 comments on commit 1630a14

Please sign in to comment.