Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ python run_tests.py -q
python run_tests.py --pattern=banner
```

The GUI help dialog also mentions the launcher version flag and the targeted
test-run pattern so you can find them quickly from inside the app.

CI is configured via GitHub Actions to run the shared `run_tests.py` entrypoint.

## Banner detection
Expand Down
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@


def main():
"""Start the Tkinter GUI launcher."""
import tkinter as tk

parser = argparse.ArgumentParser(
prog="python main.py",
description="Launch the Port Scanner GUI",
epilog="Use --version to print the installed app version and exit.",
)
Expand Down
3 changes: 3 additions & 0 deletions portscanner/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Public package exports for the port scanner app."""

__version__ = "0.2.1"


Expand All @@ -9,6 +11,7 @@ def get_version() -> str:
from .utils import export_to_file, copy_to_clipboard
from .gui import PortScannerApp

# Keep the top-level package import friendly for the GUI and scripts.
__all__ = [
"__version__",
"get_version",
Expand Down
8 changes: 7 additions & 1 deletion portscanner/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def create_widgets(self):
font=("Segoe UI", 10, "bold"),
bg="#6c6cff",
fg="white",
command=lambda: self.root.clipboard_append("MIT License - see LICENSE file"),
command=self.copy_license_to_clipboard,
)
copy_license_btn.pack(anchor=tk.W, pady=(0, 12))

Expand Down Expand Up @@ -695,6 +695,11 @@ def _queue_reset_buttons(self):
def _queue_error_dialog(self, title, message):
self.root.after(0, messagebox.showerror, title, message)

def copy_license_to_clipboard(self):
self.root.clipboard_clear()
self.root.clipboard_append("MIT License - see LICENSE file")
self.root.update_idletasks()
Comment on lines +698 to +701

def _validate_host_field(self):
val = self.normalize_host(self.host_entry.get().strip())
try:
Expand All @@ -714,6 +719,7 @@ def show_help(self):
"- Enter a target host or IP and press Scan.\n"
"- Adjust start/end ports, thread count, and timeout.\n"
"- Use python main.py --version to confirm the installed build.\n"
"- Use python run_tests.py --pattern=banner for targeted test runs.\n"
"- The window title updates with the scan target and final open-port count.\n"
"- Oversized scan ranges are rejected to avoid accidental heavy scans.\n"
"- Use Export/Copy to save results.\n"
Expand Down
Loading