diff --git a/app/config.py b/app/config.py
index 3e8a0ed..4971f9e 100644
--- a/app/config.py
+++ b/app/config.py
@@ -8,14 +8,13 @@ class Config(object):
# DEBUG_FUNCTIONS: List[Optional[str]] = []
# DEBUG_MODULES: List[Optional[str]] = ['dbconfig']
DISPLAY_SQL = False
- # ERRORS_FROM = ['noreply@midnighthax.com']
- # ERRORS_TO = ['kae@midnighthax.com']
+ ERRORS_FROM = ['noreply@midnighthax.com']
+ ERRORS_TO = ['kae@midnighthax.com']
LOG_LEVEL_STDERR = logging.ERROR
LOG_LEVEL_SYSLOG = logging.DEBUG
LOG_NAME = "urma"
- # MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
- # MAIL_PORT = int(os.environ.get('MAIL_PORT') or 25)
- # MAIL_SERVER = os.environ.get('MAIL_SERVER') or
- # "woodlands.midnighthax.com"
- # MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
- # MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS') is not None
+ MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
+ MAIL_PORT = int(os.environ.get('MAIL_PORT') or 25)
+ MAIL_SERVER = os.environ.get('MAIL_SERVER') or "woodlands.midnighthax.com"
+ MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
+ MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS') is not None
diff --git a/app/helpers.py b/app/helpers.py
index 74f5bf9..b399fc2 100644
--- a/app/helpers.py
+++ b/app/helpers.py
@@ -7,6 +7,8 @@ from email.message import EmailMessage
from config import Config
from log import log
+from typing import Any, List
+
def ask_yes_no(title: str, question: str) -> bool:
"""Ask question; return True for yes, False for no"""
@@ -16,6 +18,20 @@ def ask_yes_no(title: str, question: str) -> bool:
return button_reply == QMessageBox.Yes
+def index_ojects_by_parameter(object_list: List, param: Any):
+ """
+ Create a dictionary from passed list where each list entry is keyed
+ by passed param
+ n
+ """
+
+ results = {}
+ for obj in object_list:
+ results[getattr(obj, param)] = obj
+
+ return results
+
+
def send_mail(to_addr, from_addr, subj, body):
# From https://docs.python.org/3/library/email.examples.html
diff --git a/app/models.py b/app/models.py
index 1f2ee16..98cd6eb 100644
--- a/app/models.py
+++ b/app/models.py
@@ -4,6 +4,8 @@ import os.path
from dbconfig import Session, scoped_session
+from typing import List
+
from sqlalchemy import (
Boolean,
Column,
@@ -56,6 +58,21 @@ class Accounts(Base):
session.add(self)
session.commit()
+ @classmethod
+ def get_followed(cls, session: Session) -> List["Accounts"]:
+ """
+ Return a list of account objects that we follow
+ """
+
+ records = (
+ session.execute(
+ select(cls)
+ .where(cls.followed.is_(True))
+ ).scalars().all()
+ )
+
+ return records
+
@classmethod
def get_or_create(cls, session: Session, account_id: str) -> "Accounts":
"""
@@ -148,6 +165,21 @@ class Hashtags(Base):
session.add(self)
session.commit()
+ @classmethod
+ def get_followed(cls, session: Session) -> List["Hashtags"]:
+ """
+ Return a list of hashtags objects that we follow
+ """
+
+ records = (
+ session.execute(
+ select(cls)
+ .where(cls.followed.is_(True))
+ ).scalars().all()
+ )
+
+ return records
+
@classmethod
def get_or_create(cls, session: Session,
name: str, url: str) -> "Hashtags":
@@ -218,6 +250,21 @@ class Posts(Base):
return rec
+ @classmethod
+ def get_unrated_posts(cls, session: Session) -> List["Posts"]:
+ """
+ Return a list of Posts object that have not been rated
+ """
+
+ records = (
+ session.execute(
+ select(cls)
+ .where(cls.rating.is_(None))
+ ).scalars().all()
+ )
+
+ return records
+
class PostTags(Base):
__tablename__ = 'post_tags'
diff --git a/app/ui/double-left.png b/app/ui/double-left.png
new file mode 100644
index 0000000..781a113
Binary files /dev/null and b/app/ui/double-left.png differ
diff --git a/app/ui/double-right.png b/app/ui/double-right.png
new file mode 100644
index 0000000..c6f38b6
Binary files /dev/null and b/app/ui/double-right.png differ
diff --git a/app/ui/main_window.ui b/app/ui/main_window.ui
index 1ac1ed6..1f85129 100644
--- a/app/ui/main_window.ui
+++ b/app/ui/main_window.ui
@@ -6,181 +6,468 @@
0
0
- 800
- 574
+ 709
+ 1100
- Urma
+ MainWindow
+
+
+ false
+
+
+ background-color: #232834;
-
- -
-
-
- Username:
-
-
-
- -
-
-
-
-
-
-
- -
-
-
-
-
-
-
- -
-
-
-
-
-
-
- :/buttons/icons8-next-page-48.png:/buttons/icons8-next-page-48.png
-
-
-
- 48
- 48
-
-
-
-
- -
-
-
- Hashtags:
-
-
-
- -
-
-
-
-
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+
+
+
+ 10
+ 90
+ 351
+ 681
+
+
+
+
+ 341
+ 181
+
+
+
+ background-color: rgb(154, 153, 150); border-radius: 10px;
+
+
+
+ QFrame::StyledPanel
+
+
+ QAbstractScrollArea::AdjustIgnored
+
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Sans'; font-size:13pt; font-weight:400; font-style:normal;">
-<p style="-qt-paragraph-type:empty; margin-top:8px; margin-bottom:8px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html>
-
-
-
- -
-
-
-
-
-
-
- :/buttons/icons8-prev-page-48.png:/buttons/icons8-prev-page-48.png
-
-
-
- 48
- 48
-
-
-
-
- -
-
-
-
-
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#ffffff;">The magic of adulthood is in finding new and interesting ways of being disappointed </span><span style=" color:#5e5c64;"><a href="xxx">thisn</a> </span><a href="https://discu.eu/q/https://github.com/marsupialtail/quokka/blob/master/blog/why.md"><span style=" text-decoration: underline; color:#0000ff;">https://discu.eu/q/https://github.com/marsupialtail/quokka/blob/master/blog/why.md <br /></span></a><a href="https://discu.eu/q/https://github.com/marsupialtail/quokka/blob/master/blog/why.md"><span style=" text-decoration: underline; color:#000000;">and some black text</span></a></p></body></html>
+
+
+
+
+
+ 20
+ 770
+ 351
+ 191
+
+
+
+
+ 0
+ 181
+
+
+
+ QFrame::StyledPanel
+
+
+
+
+
+
+
+
+ 370
+ 90
+ 331
+ 871
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Sunken
+
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Sans'; font-size:13pt; font-weight:400; font-style:normal;">
-<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html>
-
-
-
- -
-
-
-
- 72
- 75
- true
-
-
-
- 2
-
-
- urma
-
-
-
- -
-
-
- Dislike
-
-
-
- :/buttons/red-cross.png:/buttons/red-cross.png
-
-
-
- 48
- 48
-
-
-
-
- -
-
-
- Not sure
-
-
-
- :/buttons/dont-know-woman.png:/buttons/dont-know-woman.png
-
-
-
- 48
- 48
-
-
-
-
- -
-
-
- Like
-
-
-
- :/buttons/green-tick.png:/buttons/green-tick.png
-
-
-
- 48
- 48
-
-
-
-
-
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#f6f5f4;">#notthis<br />#orthis</span><br /><span style=" color:#8ae234;">#butthis</span><br /><span style=" color:#f6f5f4;">#notthis</span><br /><span style=" color:#8ae234;">#yes</span><br /><span style=" color:#8ae234;">#yes</span><br /><span style=" color:#ffffff;">#no</span></p></body></html>
+
+
+
+
+
+ 10
+ 0
+ 361
+ 31
+
+
+
+
+ 0
+ 29
+
+
+
+
+ 16777215
+ 29
+
+
+
+
+ 13
+
+
+
+ QFrame::NoFrame
+
+
+ QFrame::Plain
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Sans'; font-size:13pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#5e5c64;">Boosted by</span><span style=" color:#f6f5f4;"> Jon</span> <span style=" color:#8ae234;">Baker</span></p></body></html>
+
+
+
+
+
+ 10
+ 980
+ 701
+ 63
+
+
+
+ -
+
+
+
+ 61
+ 61
+
+
+
+
+ 61
+ 61
+
+
+
+
+
+
+
+ :/buttons/double-left.png:/buttons/double-left.png
+
+
+
+ 48
+ 48
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+
+ 61
+ 61
+
+
+
+
+ 61
+ 61
+
+
+
+
+
+
+
+ :/buttons/icons8-prev-page-48.png:/buttons/icons8-prev-page-48.png
+
+
+
+ 48
+ 48
+
+
+
+
+ -
+
+
+
+ 106
+ 61
+
+
+
+
+ 106
+ 61
+
+
+
+
+
+
+
+ :/buttons/red-cross.png:/buttons/red-cross.png
+
+
+
+ 48
+ 48
+
+
+
+
+ -
+
+
+
+ 106
+ 61
+
+
+
+
+ 106
+ 61
+
+
+
+
+
+
+
+ :/buttons/dont-know-woman.png:/buttons/dont-know-woman.png
+
+
+
+ 48
+ 48
+
+
+
+
+ -
+
+
+
+ 106
+ 61
+
+
+
+
+ 106
+ 61
+
+
+
+
+
+
+
+ :/buttons/green-tick.png:/buttons/green-tick.png
+
+
+
+ 48
+ 48
+
+
+
+
+ -
+
+
+
+ 61
+ 61
+
+
+
+
+ 61
+ 61
+
+
+
+
+
+
+
+ :/buttons/icons8-next-page-48.png:/buttons/icons8-next-page-48.png
+
+
+
+ 48
+ 48
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+
+ 61
+ 61
+
+
+
+
+ 61
+ 61
+
+
+
+
+
+
+
+ :/buttons/double-right.png:/buttons/double-right.png
+
+
+
+ 48
+ 48
+
+
+
+
+
+
+
+
+
+ 10
+ 60
+ 361
+ 29
+
+
+
+
+ 0
+ 29
+
+
+
+
+ 16777215
+ 29
+
+
+
+ color: rgb(119, 118, 123);
+
+
+ @JonBaker@mastodon.xyz
+
+
+
+
+
+ 10
+ 30
+ 361
+ 29
+
+
+
+
+ 0
+ 29
+
+
+
+
+ 16777215
+ 29
+
+
+
+ QFrame::NoFrame
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Sans'; font-size:13pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#f6f5f4;">Jon</span> <span style=" color:#8ae234;">Baker</span></p></body></html>
+
+
+
+
+
+ 366
+ 90
+ 2
+ 871
+
+
+
+ background-color: rgb(119, 118, 123);
+
+
+ Qt::Vertical
+
+