Mercurial > p > roundup > code
view website/issues/detectors/patches.py @ 7743:79779293d77b
doc: add reference to full email address and purpose for lists
Added purpose for lists to the mailing list table. Also added headers.
Some grammar fixups. Promote WebChat IRC interface over client
interface as many people don't have clients installed anymore 8-(.
Added a sentence that guides the user to the address of the mailing
list. I added this after getting an issue about a request that should
have gone to the mailing list. I realised there was no reference to
the mailing lists' domain: @lists.sourceforge.net on the contact page.
I think the linked subscribe page used to provide a hint, but it
doesn't look like it does anymore.
I wonder if we should add a mailto: link there? Does sphinx obscure it
enough to prevent bot spamming?
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Wed, 21 Feb 2024 12:38:05 -0500 |
| parents | 0942fe89e82e |
| children |
line wrap: on
line source
# Auditor for patch files # Patches should be declared as text/plain (also .py files), # independent of what the browser says, and # the "patch" keyword should get set automatically. import posixpath patchtypes = ('.diff', '.patch') sourcetypes = ('.diff', '.patch', '.py') def ispatch(file, types): return posixpath.splitext(file)[1] in types def patches_text_plain(db, cl, nodeid, newvalues): if ispatch(newvalues['name'], sourcetypes): newvalues['type'] = 'text/plain' def patches_keyword(db, cl, nodeid, newvalues): # Check whether there are any new files newfiles = set(newvalues.get('files',())) if nodeid: newfiles -= set(db.issue.get(nodeid, 'files')) # Check whether any of these is a patch newpatch = False for fileid in newfiles: if ispatch(db.file.get(fileid, 'name'), patchtypes): newpatch = True break if newpatch: # Add the patch keyword if its not already there patchid = db.keyword.lookup("patch") oldkeywords = [] if nodeid: oldkeywords = db.issue.get(nodeid, 'keywords') if patchid in oldkeywords: # This is already marked as a patch return if 'keywords' not in newvalues: newvalues['keywords'] = oldkeywords newvalues['keywords'].append(patchid) def init(db): db.file.audit('create', patches_text_plain) db.issue.audit('create', patches_keyword) db.issue.audit('set', patches_keyword)
