Skip to content
Open
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
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

**Expected behavior**
A clear and concise description of what you expected to happen.

**Operating System**
Use command `hostnamectl` in Linux terminal window to find OS info.
- OS: [e.g. Raspberry Pi OS, Debian, Ubuntu, Windows]
- Version: [e.g. Bookworm, 12.0]

**Python Version**
Use command `python --version` or `python3 --version` in terminal window to find Python version.
- Version: [e.g. 3.9]

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Log Output**
Copy relevant portion of error log here. Remove sensitive API keys.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[REQUEST]"
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/other.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Other
about: All other issues
title: ''
labels: ''
assignees: ''

---

**Describe the problem**
A clear and concise description of your problem.

**Operating System**
Use command `hostnamectl` in Linux terminal window to find OS info.
- OS: [e.g. Raspberry Pi OS, Debian, Ubuntu, Windows]
- Version: [e.g. Bookworm, 12.0]

**Python Version**
Use command `python --version` or `python3 --version` in terminal window to find Python version.
- Version: [e.g. 3.9]

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Log Output**
Copy relevant portion of error log here. Remove sensitive API keys.

**Additional context**
Add any other context about the problem here.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
43 changes: 26 additions & 17 deletions PiClock3/AnalogClock/AnalogClock.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
import logging
import time
import datetime
import locale
import os
import sys

from ..Plugin import Plugin
import logging

from PyQt5 import QtGui, QtNetwork
from PyQt5.QtGui import QPixmap, QMovie, QBrush, QColor, QPainter, QTransform
from PyQt5.QtCore import Qt, QUrl, QTimer, QSize, QRect, QBuffer, QIODevice, QByteArray
from PyQt5.QtCore import Qt, QTimer
from PyQt5.QtGui import QPixmap, QTransform
from PyQt5.QtWidgets import QFrame, QLabel

from ..Plugin import Plugin

logger = logging.getLogger(__name__)


class Plugin(Plugin):

def __init__(self, piclock, name, config):
super().__init__(piclock, name, config)
self.ctimer = None
self.lastmin = None
self.secpixmap2 = None
self.secpixmap = None
self.minpixmap2 = None
self.minpixmap = None
self.hourpixmap2 = None
self.hourpixmap = None
self.sechand = None
self.minhand = None
self.hourhand = None
self.clockrect = None
self.clockface = None

def start(self):
self.clockface = QFrame(self.block)
Expand Down Expand Up @@ -74,9 +83,9 @@ def pageChange(self):

def tick(self):
time_now = datetime.datetime.now()
if 'date-locale' in self.config:
if 'locale' in self.config:
try:
locale.setlocale(locale.LC_TIME, Config.DateLocale)
locale.setlocale(locale.LC_TIME, self.config.locale)
except BaseException:
pass
angle = time_now.second * 6
Expand All @@ -91,8 +100,8 @@ def tick(self):
self.sechand.setPixmap(self.secpixmap2)
ts = self.secpixmap2.size()
self.sechand.setGeometry(
self.clockrect.center().x() - ts.width() / 2,
self.clockrect.center().y() - ts.height() / 2,
int(self.clockrect.center().x() - ts.width() / 2),
int(self.clockrect.center().y() - ts.height() / 2),
ts.width(),
ts.height()
)
Expand All @@ -110,8 +119,8 @@ def tick(self):
self.minhand.setPixmap(minpixmap2)
ts = minpixmap2.size()
self.minhand.setGeometry(
self.clockrect.center().x() - ts.width() / 2,
self.clockrect.center().y() - ts.height() / 2,
int(self.clockrect.center().x() - ts.width() / 2),
int(self.clockrect.center().y() - ts.height() / 2),
ts.width(),
ts.height()
)
Expand All @@ -128,8 +137,8 @@ def tick(self):
self.hourhand.setPixmap(hourpixmap2)
ts = hourpixmap2.size()
self.hourhand.setGeometry(
self.clockrect.center().x() - ts.width() / 2,
self.clockrect.center().y() - ts.height() / 2,
int(self.clockrect.center().x() - ts.width() / 2),
int(self.clockrect.center().y() - ts.height() / 2),
ts.width(),
ts.height()
)
18 changes: 6 additions & 12 deletions PiClock3/Astral/Astral.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import datetime
import logging

import time
import datetime
import locale
import os
import random
import tzlocal

from ..Plugin import Plugin

from PyQt5.QtCore import QTimer
from astral import LocationInfo
from astral.sun import sun
from astral import moon
from astral.sun import sun

from PyQt5.QtCore import QTimer
from ..Plugin import Plugin

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -48,7 +42,7 @@ def doAstral(self):
return

locationInfo = LocationInfo('here', 'here',
tzlocal.get_localzone().zone,
tzlocal.get_localzone_name(),
self.piclock.expand(
self.config.location.lattitude),
self.piclock.expand(self.config.location.longitude))
Expand All @@ -61,7 +55,7 @@ def doAstral(self):
self.pluginData['moonphase'] = self.piclock.language(
self.phaseWords(m))
self.pluginData['moonage'] = m
#self.pluginData['sunrise'] = s['sunrise']
# self.pluginData['sunrise'] = s['sunrise']
ds = self.piclock.expand(self.config.format)
self.block.setText(ds)

Expand Down
18 changes: 7 additions & 11 deletions PiClock3/Date/Date.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import logging

import time
import datetime
import locale
import os
import random
import tzlocal

from ..Plugin import Plugin
import logging

from PyQt5.QtCore import QTimer

from ..Plugin import Plugin

logger = logging.getLogger(__name__)


Expand All @@ -23,6 +18,7 @@ class Date(Plugin):

def __init__(self, piclock, name, config):
super().__init__(piclock, name, config)
self.timer = None
self.lastDay = -1

def start(self):
Expand All @@ -48,11 +44,11 @@ def doDate(self):

# date
sup = 'th'
if (now.day == 1 or now.day == 21 or now.day == 31):
if now.day == 1 or now.day == 21 or now.day == 31:
sup = 'st'
if (now.day == 2 or now.day == 22):
if now.day == 2 or now.day == 22:
sup = 'nd'
if (now.day == 3 or now.day == 23):
if now.day == 3 or now.day == 23:
sup = 'rd'
if 'locale' in self.config:
sup = ""
Expand Down
18 changes: 10 additions & 8 deletions PiClock3/DigitalClock/DigitalClock.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
import datetime
import logging

import time
import datetime
import locale
import os
from PyQt5.QtCore import Qt, QTimer
from PyQt5.QtGui import QColor
from PyQt5.QtWidgets import QLabel, QGraphicsDropShadowEffect

from ..Plugin import Plugin

from PyQt5 import QtGui, QtNetwork
from PyQt5.QtGui import QPixmap, QMovie, QBrush, QColor, QPainter, QTransform
from PyQt5.QtCore import Qt, QUrl, QTimer, QSize, QRect, QBuffer, QIODevice, QByteArray
from PyQt5.QtWidgets import QFrame, QLabel, QGraphicsDropShadowEffect
logger = logging.getLogger(__name__)


class DigitalClock(Plugin):

def __init__(self, piclock, name, config):
super().__init__(piclock, name, config)
self.ctimer = None
self.lasttimestr = None
self.glow = None
self.clockrect = None
self.clockface = None

def fontCalc(self, size):
return "%dpx" % (float(size) * self.block.frameRect().height())
Expand Down
Loading