]>
git.madduck.net Git - etc/neomutt.git/commitdiff
madduck's git repository
Every one of the projects in this repository is available at the canonical
URL git://git.madduck.net/madduck/pub/<projectpath> — see
each project's metadata for the exact URL.
All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@ git. madduck. net .
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
SSH access, as well as push access can be individually
arranged .
If you use my repositories frequently, consider adding the following
snippet to ~/.gitconfig and using the third clone URL listed for each
project:
[url "git://git.madduck.net/madduck/"]
insteadOf = madduck:
summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (parent:
6648ac7 )
help="Only build, don't send the message",
)
help="Only build, don't send the message",
)
+ parser.add_argument(
+ "--domain",
+ help="Domain to use in content IDs",
+ )
+
parser.add_argument(
"--tempdir",
metavar="DIR",
parser.add_argument(
"--tempdir",
metavar="DIR",
def __init__(self):
self._images = OrderedDict()
def __init__(self):
self._images = OrderedDict()
- def register(self, path, description=None):
+ def register(self, path, description=None, *, domain=None ):
# path = str(pathlib.Path(path).expanduser())
path = os.path.expanduser(path)
if path.startswith("/"):
path = f"file://{path}"
# path = str(pathlib.Path(path).expanduser())
path = os.path.expanduser(path)
if path.startswith("/"):
path = f"file://{path}"
- cid = make_msgid()[1:-1]
+ cid = make_msgid(domain=domain )[1:-1]
self._images[path] = InlineImageInfo(cid, description)
return cid
self._images[path] = InlineImageInfo(cid, description)
return cid
tempdir=None,
extensions=None,
extension_configs=None,
tempdir=None,
extensions=None,
extension_configs=None,
):
# TODO extension_configs need to be handled differently
extension_configs = extension_configs or {}
):
# TODO extension_configs need to be handled differently
extension_configs = extension_configs or {}
for img in soup.find_all("img"):
uri = img.attrs["src"]
desc = img.attrs.get("title", img.attrs.get("alt"))
for img in soup.find_all("img"):
uri = img.attrs["src"]
desc = img.attrs.get("title", img.attrs.get("alt"))
- cid = image_registry.register(uri, desc)
+ cid = image_registry.register(uri, desc, domain=domain )
img.attrs["src"] = f"cid:{cid}"
htmlsig = str(soup)
img.attrs["src"] = f"cid:{cid}"
htmlsig = str(soup)
only_build=False,
max_other_attachments=20,
tempdir=None,
only_build=False,
max_other_attachments=20,
tempdir=None,
debug_commands=False,
debug_walk=False,
):
debug_commands=False,
debug_walk=False,
):
related_to_html_only=related_to_html_only,
tempdir=tempdir,
extensions=extensions,
related_to_html_only=related_to_html_only,
tempdir=tempdir,
extensions=extensions,
)
mimetree = MIMETreeDFWalker(debug=debug_walk)
)
mimetree = MIMETreeDFWalker(debug=debug_walk)
max_other_attachments=args.max_number_other_attachments,
only_build=args.only_build,
tempdir=args.tempdir,
max_other_attachments=args.max_number_other_attachments,
only_build=args.only_build,
tempdir=args.tempdir,
debug_commands=args.debug_commands,
debug_walk=args.debug_walk,
)
debug_commands=args.debug_commands,
debug_walk=args.debug_walk,
)
assert not cid.endswith(">")
assert const1 in reg
assert not cid.endswith(">")
assert const1 in reg
+ @pytest.mark.imgproc
+ def test_image_registry_domain(self, const1, const2):
+ reg = ImageRegistry()
+ cid = reg.register(const1, domain=const2)
+ assert f"@{const2}" in cid
+ assert not cid.startswith("<")
+ assert not cid.endswith(">")
+ assert const1 in reg
+
@pytest.mark.imgproc
def test_image_registry_file_uri(self, const1):
reg = ImageRegistry()
@pytest.mark.imgproc
def test_image_registry_file_uri(self, const1):
reg = ImageRegistry()