Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Windows specific code #19

Merged
merged 2 commits into from
Nov 20, 2024
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
26 changes: 8 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Fetchtastic is a utility for downloading and managing the latest Meshtastic Andr

- [Installation](#installation)
- [Termux Installation (Android)](#termux-installation-android)
- [Windows/Mac/Linux Installation](#windowsmaclinux-installation)
- [Linux/Mac Installation](#linuxmac-installation)
- [Usage](#usage)
- [Setup Process](#setup-process)
- [Command List](#command-list)
Expand Down Expand Up @@ -42,21 +42,21 @@ pkg install python python-pip openssl -y
pip install fetchtastic
```

### Windows/Mac/Linux Installation
### Linux/Mac Installation

Fetchtastic can also be installed on Windows, macOS, or Linux systems.
Fetchtastic can also be installed on Linux or macOS systems.

#### Install with pipx (Recommended)

It's recommended to use `pipx` to install Fetchtastic in an isolated environment.
It's recommended to use `pipx` to install Fetchtastic in an isolated environment. (If you prefer, you can use `pip` too.)

1. **Install pipx**:

Follow the installation instructions for your platform on the [pipx documentation page](https://pypa.github.io/pipx/installation/).

Restart your terminal or command prompt after installing pipx.
Restart your terminal after installing pipx.

3. **Install Fetchtastic with pipx**:
2. **Install Fetchtastic with pipx**:

```bash
pipx install fetchtastic
Expand All @@ -82,7 +82,7 @@ During setup, you will be able to:
- Choose to receive notifications only when new files are downloaded. (Optional)
- Add a cron job to run Fetchtastic regularly. (Optional)
- On Termux, Fetchtastic can be scheduled to run daily at 3 AM using Termux's cron.
- On Windows/Mac/Linux, Fetchtastic can be scheduled using the system's cron scheduler.
- On Linux/Mac, Fetchtastic can be scheduled using the system's cron scheduler.

### Command List

Expand All @@ -108,24 +108,14 @@ You can manually edit the configuration file to change the settings.

During setup, you have the option to add a cron job that runs Fetchtastic daily at 3 AM.

#### Termux/Linux/Mac OS

The setup process will configure the cron job using the system's cron implementation.
The setup process will configure the cron job using Termux's cron implementation.

To modify the cron job, you can run:

```bash
crontab -e
```

#### Windows

You can schedule Fetchtastic to run automatically using the Task Scheduler.

1. Open **Task Scheduler**.
2. Create a new **Basic Task**.
3. Set the action to **Start a program** and enter `fetchtastic download`.

### Notifications via NTFY

If you choose to set up notifications, Fetchtastic will send updates to your specified NTFY topic.
Expand Down
13 changes: 0 additions & 13 deletions app/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,19 +135,6 @@ def copy_to_clipboard_func(text):
"xclip or xsel not found. Install xclip or xsel to use clipboard functionality."
)
return False
elif system == "Windows":
# Windows
try:
import win32clipboard

win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardText(text)
win32clipboard.CloseClipboard()
return True
except Exception as e:
print(f"An error occurred while copying to clipboard: {e}")
return False
else:
print("Clipboard functionality is not supported on this platform.")
return False
Expand Down
15 changes: 0 additions & 15 deletions app/setup_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ def is_termux():
def get_platform():
if is_termux():
return "termux"
elif platform.system() == "Windows":
return "windows"
elif platform.system() == "Darwin":
return "mac"
elif platform.system() == "Linux":
Expand Down Expand Up @@ -469,19 +467,6 @@ def copy_to_clipboard_func(text):
"xclip or xsel not found. Install xclip or xsel to use clipboard functionality."
)
return False
elif system == "Windows":
# Windows
try:
import win32clipboard

win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardText(text)
win32clipboard.CloseClipboard()
return True
except Exception as e:
print(f"An error occurred while copying to clipboard: {e}")
return False
else:
print("Clipboard functionality is not supported on this platform.")
return False
Expand Down
4 changes: 1 addition & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = fetchtastic
version = 0.2.0
version = 0.2.1
author = Jeremiah K
author_email = [email protected]
description = Meshtastic Firmware and APK Downloader
Expand All @@ -14,7 +14,6 @@ classifiers =
Operating System :: Android
Operating System :: POSIX :: Linux
Operating System :: MacOS
Operating System :: Microsoft :: Windows

[options]
packages = find:
Expand All @@ -23,7 +22,6 @@ install_requires =
pick
PyYAML
urllib3
pywin32; platform_system == "Windows"

[options.packages.find]
where = .
Expand Down