Skip to content

Commit c2a2637

Browse files
committed
refactor: major improvements and bug fixes
1 parent b2e53d9 commit c2a2637

16 files changed

+1692
-197
lines changed

.gitignore

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
env/
8+
build/
9+
develop-eggs/
10+
dist/
11+
downloads/
12+
eggs/
13+
.eggs/
14+
lib/
15+
lib64/
16+
parts/
17+
sdist/
18+
var/
19+
*.egg-info/
20+
.installed.cfg
21+
*.egg
22+
23+
# Virtual Environment
24+
venv/
25+
ENV/
26+
env/
27+
28+
# Application specific
29+
uploads/
30+
qr_code.png
31+
32+
# OS specific
33+
.DS_Store
34+
Thumbs.db
35+
.directory
36+
37+
# IDE
38+
.idea/
39+
.vscode/
40+
*.swp
41+
*.swo

README.md

+45-6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ WebShare for Windows is a file-sharing application that utilizes PyQt5 for a dar
88
- **QR Code Generation**: Automatically generates a QR code for easy access to the server URL.
99
- **Dark Mode UI**: A modern, visually appealing interface.
1010
- **File Upload & Download**: List and download files from the web interface.
11+
- **File Management**: Delete files from the web interface or application.
12+
- **Storage Statistics**: Track file count and storage usage.
13+
- **Upload Progress**: Visual feedback during file uploads.
14+
- **Customizable Port**: Configure the server port as needed.
15+
- **About Dialog**: View information about the application.
16+
- **Update Checker**: Check for and download new versions of the application.
1117

1218
## 📄 Requirements
1319

@@ -16,27 +22,60 @@ WebShare for Windows is a file-sharing application that utilizes PyQt5 for a dar
1622

1723
## 💻 Installation & Usage
1824

19-
1. Download the latest executable from the [Releases](https://github.com/oop7/WebShare-for-Windows/releases) Section.
20-
25+
1. Clone this repository:
26+
```bash
27+
git clone https://github.com/oop7/WebShare-for-Windows.git
28+
cd WebShare-for-Windows
29+
```
30+
2131
2. Install the required packages:
2232
```bash
2333
pip install -r requirements.txt
2434
```
35+
2536
3. Run the application:
2637
```bash
27-
Run.bat
38+
python main.py
2839
```
40+
41+
Alternatively, you can download the latest executable from the [Releases](https://github.com/oop7/WebShare-for-Windows/releases) section.
42+
2943
### **Usage**
3044

3145
1. Click "Start WebShare Server" to launch the local server.
3246
2. A QR code will be generated; scan it to access the web interface.
3347
3. Use the web interface to upload and download files.
48+
4. View storage statistics in the application.
49+
5. Delete files individually from the web interface or all at once from the application.
50+
6. Click "About" to view information about the application.
51+
7. Click "Check for Updates" to check for and download new versions.
52+
53+
## 🏗️ Project Structure
54+
55+
```
56+
WebShare-for-Windows/
57+
├── app/ # Application package
58+
│ ├── static/ # Static files for Flask
59+
│ ├── templates/ # HTML templates
60+
│ ├── utils/ # Utility functions
61+
│ ├── __init__.py # Package initialization
62+
│ ├── gui.py # PyQt5 GUI implementation
63+
│ └── server.py # Flask server implementation
64+
├── uploads/ # Default upload directory
65+
├── .gitignore # Git ignore file
66+
├── LICENSE # MIT License
67+
├── main.py # Main application entry point
68+
├── README.md # Project documentation
69+
├── requirements.txt # Python dependencies
70+
└── Run.bat # Windows batch script to run the app
71+
```
3472

3573
## 📜 License
3674
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
3775

3876
## 📙 Acknowledgments
3977

40-
- PyQt5
41-
- Flask
42-
- QRCode
78+
- PyQt5 for the GUI framework
79+
- Flask for the web server
80+
- QRCode for QR code generation
81+
- Humanize for human-readable file sizes

Run.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
@echo off
2-
python "%~dp0main.py"
2+
python main.py
33
pause

app/__init__.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""
2+
WebShare for Windows application package
3+
"""
4+
5+
# Import version information
6+
from app.version import __version__, __author__
7+
8+
# Import utility functions first
9+
from app.utils import get_local_ip, generate_qr_image, get_pixmap_from_base64
10+
11+
# Then import server functionality
12+
from app.server import app, run_server, UPLOAD_FOLDER
13+
14+
# Finally import the GUI class
15+
from app.gui import WebShareApp
16+
17+
# Export all needed symbols
18+
__all__ = ['WebShareApp', 'app', 'run_server', '__version__', '__author__']

0 commit comments

Comments
 (0)