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

Sks dev home pc #13

Merged
merged 3 commits into from
Nov 26, 2023
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
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ A simple CLI system for fetch feed from a Rss feed.
- virtualenv or your favourite Python environment tool

# Get Started

- Clone the repository
```sh
git clone [email protected]:sksshouvo/rssFeedFetcher.git
Expand All @@ -35,7 +34,6 @@ pip install -r requirements.txt
```sh
python main.pyw
```

# Branching Model

We use a branching model similar to this site (https://nvie.com/posts/a-successful-git-branching-model/).
Expand All @@ -48,12 +46,10 @@ To publish any changes instead of direct push, create a **PR** to **develop**
- hotfix-#.#.#
- main


## NOTE : WE BELIEVE IN MAINTAINING STANDARD.

SO DON'T FORGET TO RUN AT LEAST ```flake8``` AND ```isort``` IN CHANGED FILE BEFORE ANY NEW COMMIT AND PULL REQUEST


# Copyright

Copyright (c) 2023 sksshouvo inc. All rights reserved.
Copyright (c) 2023 sksshouvo inc. All rights reserved.
Binary file modified databases/rss_feed.db
Binary file not shown.
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ tk==0.1.0
tksheet==6.2.9
icecream==2.1.3
plyer==2.1.0
playsound==1.3.0
playsound==1.3.0
desktop-notifier==3.5.6
34 changes: 9 additions & 25 deletions views/test.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,12 @@
import tkinter as tk
from tksheet import Sheet
import asyncio
from desktop_notifier import DesktopNotifier

notifier = DesktopNotifier()

class demo(tk.Tk):
def __init__(self):
tk.Tk.__init__(self)
self.grid_columnconfigure(0, weight = 1)
self.grid_rowconfigure(0, weight = 1)
self.frame = tk.Frame(self)
self.frame.grid_columnconfigure(0, weight = 1)
self.frame.grid_rowconfigure(0, weight = 1)
self.sheet = Sheet(self.frame,
data = [
[
f"Row {r}, Column {c}\nnewline1\nnewline2"
for c in range(50)
]
for r in range(500)
]
)
self.sheet.enable_bindings()
self.frame.grid(row = 0, column = 0, sticky = "nswe")
self.sheet.grid(row = 0, column = 0, sticky = "nswe")
async def main():
n = await notifier.send(title="Hello world!", message="Sent from Python")
await asyncio.sleep(5) # wait a bit before clearing notification
await notifier.clear(n) # removes the notification
await notifier.clear_all() # removes all notifications for this app


app = demo()
app.mainloop()
asyncio.run(main())
28 changes: 8 additions & 20 deletions views/view.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import webbrowser

import tkinter
import tkinter.font as tkFont
from tkinter import messagebox

from classes.rss_feed import rss_feed_class
from classes.validation import Validation
from config import settings
from model.rss_feed_model import RssFeedModel
from classes.notifier.test_notifications import LinuxNotificationHandler
from classes.notifications import NotificationHandler
from tkinter import messagebox
import threading
import tkinter
import tkinter.font as tkFont
import webbrowser


class View:
Expand Down Expand Up @@ -46,10 +42,11 @@ def on_select(self, event):
webbrowser.open_new_tab(link)

def on_start_button_click(self, link_input, interval):
self.start_button.config(text="Running", state="disabled")
self.stop_button.config(text="Stop", state="normal")

self.start_action(link_input, interval)

self.start_button.config(text="Running", state="disabled")
self.stop_button.config(text="Stop", state="normal")

def start_action(self, link_input, interval):
rss_feed_fetcher = rss_feed_class()
Expand All @@ -72,7 +69,7 @@ def start_action(self, link_input, interval):
self.listbox.place(x=20, y=190, width=750)
new_rss_feeds = []
old_rss_feeds = []
# new_rss_feed_count = 0

for index, feed_data in enumerate(self.rss_feed_data[:self.initial_show_limit], start=1):
data_set = f"{index}\t -\t {feed_data[1]}"
if not rss_feed_model.check_for_new_data(link=feed_data[2]):
Expand All @@ -87,15 +84,6 @@ def start_action(self, link_input, interval):
for data in full_data_set:
self.listbox.insert(tkinter.END, data)

notification_handler = NotificationHandler(self.root)
notification_handler.handle_notifications(new_rss_feeds)
# threading.Thread(target=notification_handler.handle_notifications, args=[new_rss_feeds])

# lnh = LinuxNotificationHandler()
# lnh.show_notification("Title", "NEw message")

# Notification.get_notification(new_rss_feed_count)

new_rss_feed_count = 0
self.listbox.bind("<<ListboxSelect>>", self.on_select)
self.schedule_refresh(link_input, interval)
Expand Down