forked from solderpunk/AV-98
fixes opening mailto links
This commit is contained in:
parent
dc238309dd
commit
0666aaaa7a
|
@ -4,6 +4,7 @@
|
|||
Changes since beta1
|
||||
- "--sync" can optionnaly take some lists as arguments, in order to make for specific sync
|
||||
- fixes gophermap being considered as gemtext files
|
||||
- fixes opening mailto links
|
||||
|
||||
## 2.0-beta1 - September 05th 2023
|
||||
This is an an experimental release. Bug reports and feedbacks are welcome on the offpunk-devel list.
|
||||
|
|
7
opnk.py
7
opnk.py
|
@ -191,6 +191,8 @@ class opencache():
|
|||
return False
|
||||
elif "://" in inpath:
|
||||
cachepath = netcache.fetch(inpath,**kwargs)
|
||||
elif inpath.startswith("mailto:"):
|
||||
cachepath = inpath
|
||||
elif os.path.exists(inpath):
|
||||
cachepath = inpath
|
||||
else:
|
||||
|
@ -242,10 +244,11 @@ class opencache():
|
|||
else:
|
||||
mimetype = ansicat.get_mime(cachepath)
|
||||
if mimetype == "mailto":
|
||||
resp = input("Send an email to %s Y/N? " %inpath)
|
||||
mail = inpath[7:]
|
||||
resp = input("Send an email to %s Y/N? " %mail)
|
||||
if resp.strip().lower() in ("y", "yes"):
|
||||
if _HAS_XDGOPEN :
|
||||
run("xdg-open mailto:%s", parameter=inpath ,direct_output=True)
|
||||
run("xdg-open mailto:%s", parameter=mail,direct_output=True)
|
||||
else:
|
||||
print("Cannot find a mail client to send mail to %s" %inpath)
|
||||
print("Please install xdg-open (usually from xdg-util package)")
|
||||
|
|
Loading…
Reference in New Issue