Run of fresh-snapshots for mwc

Merge these changes:

git pull https://janitor.debian.net/git/mwc fresh-snapshots/main
git pull https://janitor.debian.net/git/mwc fresh-snapshots/pristine-tar
git pull https://janitor.debian.net/git/mwc fresh-snapshots/upstream

Summary

Merged new upstream version: 2.0.5+git20190929.1.9793052 (was: 2.0.5).

Diff

Branch: main

diff --git a/debian/changelog b/debian/changelog
index 70d54bf..06d4840 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+mwc (2.0.5+git20190929.1.9793052-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Tue, 08 Mar 2022 04:22:44 -0000
+
 mwc (2.0.5-1) unstable; urgency=medium
 
   * New upstream release.
diff --git a/debian/patches/0001-config.patch b/debian/patches/0001-config.patch
index df47bb4..dd212f8 100644
--- a/debian/patches/0001-config.patch
+++ b/debian/patches/0001-config.patch
@@ -5,11 +5,11 @@ Author: Jörg Frings-Fürst <jff@jff-webhosting.net>
 Last-Update: 2017-10-14
 ---
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
-Index: trunk/mwc.py
+Index: mwc/mwc.py
 ===================================================================
---- trunk.orig/mwc.py
-+++ trunk/mwc.py
-@@ -198,7 +198,7 @@ def pollWebsites():
+--- mwc.orig/mwc.py
++++ mwc/mwc.py
+@@ -205,7 +205,7 @@ def pollWebsites():
  
  
  if __name__ == "__main__":
@@ -18,7 +18,7 @@ Index: trunk/mwc.py
      dryrun = None
  
      try:
-@@ -215,7 +215,23 @@ if __name__ == "__main__":
+@@ -222,7 +222,23 @@ if __name__ == "__main__":
          elif opt in ('-d', '--dry-run'):
              dryrun = arg
  
@@ -43,10 +43,10 @@ Index: trunk/mwc.py
  
      if dryrun:
          for thesite in config.sites:
-Index: trunk/mwcfeedserver.py
+Index: mwc/mwcfeedserver.py
 ===================================================================
---- trunk.orig/mwcfeedserver.py
-+++ trunk/mwcfeedserver.py
+--- mwc.orig/mwcfeedserver.py
++++ mwc/mwcfeedserver.py
 @@ -14,7 +14,7 @@ import getopt
  
  bind = 'localhost'
diff --git a/mwc.py b/mwc.py
index 22a9dca..5098786 100755
--- a/mwc.py
+++ b/mwc.py
@@ -65,7 +65,7 @@ def genFeedItem(subject, content, link, change):
 
 
 # sends mail notification
-def sendmail(receiver, subject, content, sendAsHtml, link, encoding=None):
+def sendmail(receivers, subject, content, sendAsHtml, link, encoding=None):
     global mailsession, defaultEncoding
 
     if encoding is None:
@@ -83,7 +83,7 @@ def sendmail(receiver, subject, content, sendAsHtml, link, encoding=None):
         mail = MIMEText(content, 'plain', encoding)
 
     mail['From'] = config.sender
-    mail['To'] = receiver
+    mail['To'] = ", ".join(receivers)
     mail['Subject'] = Header(subject, encoding)
 
     # initialize session once, not each time this method gets called
@@ -155,7 +155,7 @@ def pollWebsites():
             print('WARNING: ' + str(e))
             if config.enableMailNotifications:
                 if config.maxMailsPerSession == -1 or mailsSent < config.maxMailsPerSession:
-                    sendmail(receiver=receiver, subject=subject, content=str(e), sendAsHtml=False, link=None)
+                    sendmail(receivers=[receiver], subject=subject, content=str(e), sendAsHtml=False, link=None)
                     mailsSent = mailsSent + 1
             if config.enableRSSFeed:
                 feedXML.xpath('//channel')[0].append(genFeedItem(subject, str(e), "", 0))
@@ -168,7 +168,7 @@ def pollWebsites():
 
             contenthash = hashlib.md5(content.content.encode(content.encoding)).hexdigest()
             if contenthash not in fileHashes:
-                if config.maxMailsPerSession == -1 or mailsSent < config.maxMailsPerSession:
+                if (not config.enableMailNotifications) or config.maxMailsPerSession == -1 or mailsSent < config.maxMailsPerSession:
                     sessionHashes.append(contenthash)
                     changedContents.append(content)
 
@@ -176,7 +176,10 @@ def pollWebsites():
                     print('    ' + subject)
                     if config.enableMailNotifications and len(fileHashes) > 0:
                         sendAsHtml = (content.contenttype == 'html')
-                        sendmail(receiver=receiver, subject=subject, content=content.content, sendAsHtml=sendAsHtml, link=content.uri, encoding=content.encoding)
+                        contentReceivers = [receiver]
+                        if content.receivers is not None:
+                            contentReceivers.extend(content.receivers)
+                        sendmail(receivers=contentReceivers, subject=subject, content=content.content, sendAsHtml=sendAsHtml, link=content.uri, encoding=content.encoding)
                         mailsSent = mailsSent + 1
 
                     if config.enableRSSFeed:
@@ -188,6 +191,8 @@ def pollWebsites():
             runParsers(site['postRun'], changedContents)
 
         if len(changedContents) > 0:
+            if site.get("keepHashes", False):
+                sessionHashes.extend(fileHashes)
             storeHashes(site['name'], sessionHashes)
             print('        ' + str(len(changedContents)) + ' updates')
 
@@ -235,7 +240,7 @@ if __name__ == "__main__":
             msg = str(sys.exc_info()[0]) + '\n\n' + traceback.format_exc()
             print(msg)
             if config.receiver != '':
-                sendmail(receiver=config.receiver, subject='[mwc] Something went wrong ...', content=msg, sendAsHtml=False, link=None)
+                sendmail(receivers=[config.receiver], subject='[mwc] Something went wrong ...', content=msg, sendAsHtml=False, link=None)
 
         if mailsession:
             mailsession.quit()
diff --git a/mwctools.py b/mwctools.py
index 1dca2e6..4d988c9 100755
--- a/mwctools.py
+++ b/mwctools.py
@@ -33,13 +33,14 @@ class Receiver(Parser):
 
 
 class Content:
-    def __init__(self, uri, encoding, title, content, contenttype, additional=None):
+    def __init__(self, uri, encoding, title, content, contenttype, additional=None, receivers=None):
         self.uri = uri
         self.encoding = encoding
         self.title = title
         self.content = content
         self.contenttype = contenttype
         self.additional = additional
+        self.receivers = receivers
 
 
 # returns a short subject line

Branch: pristine-tar

diff --git a/mwc_2.0.5+git20190929.1.9793052.orig.tar.gz.delta b/mwc_2.0.5+git20190929.1.9793052.orig.tar.gz.delta
new file mode 100644
index 0000000..b8b8ca2
Binary files /dev/null and b/mwc_2.0.5+git20190929.1.9793052.orig.tar.gz.delta differ
diff --git a/mwc_2.0.5+git20190929.1.9793052.orig.tar.gz.id b/mwc_2.0.5+git20190929.1.9793052.orig.tar.gz.id
new file mode 100644
index 0000000..d678bf6
--- /dev/null
+++ b/mwc_2.0.5+git20190929.1.9793052.orig.tar.gz.id
@@ -0,0 +1 @@
+ae94a3aa9aa8fa7b69c3279d2bb6e3f33ba74b62

Branch: upstream

Tag: upstream/2.0.5+git20190929.1.9793052
diff --git a/mwc.py b/mwc.py
index 22a9dca..5098786 100755
--- a/mwc.py
+++ b/mwc.py
@@ -65,7 +65,7 @@ def genFeedItem(subject, content, link, change):
 
 
 # sends mail notification
-def sendmail(receiver, subject, content, sendAsHtml, link, encoding=None):
+def sendmail(receivers, subject, content, sendAsHtml, link, encoding=None):
     global mailsession, defaultEncoding
 
     if encoding is None:
@@ -83,7 +83,7 @@ def sendmail(receiver, subject, content, sendAsHtml, link, encoding=None):
         mail = MIMEText(content, 'plain', encoding)
 
     mail['From'] = config.sender
-    mail['To'] = receiver
+    mail['To'] = ", ".join(receivers)
     mail['Subject'] = Header(subject, encoding)
 
     # initialize session once, not each time this method gets called
@@ -155,7 +155,7 @@ def pollWebsites():
             print('WARNING: ' + str(e))
             if config.enableMailNotifications:
                 if config.maxMailsPerSession == -1 or mailsSent < config.maxMailsPerSession:
-                    sendmail(receiver=receiver, subject=subject, content=str(e), sendAsHtml=False, link=None)
+                    sendmail(receivers=[receiver], subject=subject, content=str(e), sendAsHtml=False, link=None)
                     mailsSent = mailsSent + 1
             if config.enableRSSFeed:
                 feedXML.xpath('//channel')[0].append(genFeedItem(subject, str(e), "", 0))
@@ -168,7 +168,7 @@ def pollWebsites():
 
             contenthash = hashlib.md5(content.content.encode(content.encoding)).hexdigest()
             if contenthash not in fileHashes:
-                if config.maxMailsPerSession == -1 or mailsSent < config.maxMailsPerSession:
+                if (not config.enableMailNotifications) or config.maxMailsPerSession == -1 or mailsSent < config.maxMailsPerSession:
                     sessionHashes.append(contenthash)
                     changedContents.append(content)
 
@@ -176,7 +176,10 @@ def pollWebsites():
                     print('    ' + subject)
                     if config.enableMailNotifications and len(fileHashes) > 0:
                         sendAsHtml = (content.contenttype == 'html')
-                        sendmail(receiver=receiver, subject=subject, content=content.content, sendAsHtml=sendAsHtml, link=content.uri, encoding=content.encoding)
+                        contentReceivers = [receiver]
+                        if content.receivers is not None:
+                            contentReceivers.extend(content.receivers)
+                        sendmail(receivers=contentReceivers, subject=subject, content=content.content, sendAsHtml=sendAsHtml, link=content.uri, encoding=content.encoding)
                         mailsSent = mailsSent + 1
 
                     if config.enableRSSFeed:
@@ -188,6 +191,8 @@ def pollWebsites():
             runParsers(site['postRun'], changedContents)
 
         if len(changedContents) > 0:
+            if site.get("keepHashes", False):
+                sessionHashes.extend(fileHashes)
             storeHashes(site['name'], sessionHashes)
             print('        ' + str(len(changedContents)) + ' updates')
 
@@ -235,7 +240,7 @@ if __name__ == "__main__":
             msg = str(sys.exc_info()[0]) + '\n\n' + traceback.format_exc()
             print(msg)
             if config.receiver != '':
-                sendmail(receiver=config.receiver, subject='[mwc] Something went wrong ...', content=msg, sendAsHtml=False, link=None)
+                sendmail(receivers=[config.receiver], subject='[mwc] Something went wrong ...', content=msg, sendAsHtml=False, link=None)
 
         if mailsession:
             mailsession.quit()
diff --git a/mwctools.py b/mwctools.py
index 1dca2e6..4d988c9 100755
--- a/mwctools.py
+++ b/mwctools.py
@@ -33,13 +33,14 @@ class Receiver(Parser):
 
 
 class Content:
-    def __init__(self, uri, encoding, title, content, contenttype, additional=None):
+    def __init__(self, uri, encoding, title, content, contenttype, additional=None, receivers=None):
         self.uri = uri
         self.encoding = encoding
         self.title = title
         self.content = content
         self.contenttype = contenttype
         self.additional = additional
+        self.receivers = receivers
 
 
 # returns a short subject line

Publish Blockers

  • ☑ run was successful
  • ☑ package has not been removed from the archive
  • ☑ command has not changed
  • ☒ not yet reviewed, but review needed
  • ☑ 0 publish attempts so far.not currently attempting to back off
  • ☑ proposals not currently being rate-limited for maintainer debian@jff.email
  • ☑ change set f7a4e695-7152-4c23-a0a6-ba28d6855229 is ready

Resulting package

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots mwc

Lintian Result

Full worker log Full build log