~earboxer/browset

7682658a6d9a0e167fe22debcbee77522b42be92 — Zach DeCook 1 year, 1 month ago dd3051a
protocol: add about uri scheme
2 files changed, 12 insertions(+), 0 deletions(-)

M browset.py
A protocol/about.py
M browset.py => browset.py +2 -0
@@ 10,12 10,14 @@ from mime.highlightedcode import HighlightedCode,mimetolexer
from protocol.gemini import GeminiProtocol
from protocol.data import DataProtocol
from protocol.http import HttpProtocol
from protocol.about import AboutProtocol

protocols = {
    "gemini": GeminiProtocol,
    "data": DataProtocol,
    "http": HttpProtocol,
    "https": HttpProtocol,
    "about": AboutProtocol,
}

class Browset(App):

A protocol/about.py => protocol/about.py +10 -0
@@ 0,0 1,10 @@
class AboutProtocol():
  def get(url):
    page = url.split(':')[1]
    if page == 'about':
      return ('text/gemini', [
        '=>about:about\n',
        '=>about:blank\n',
      ])
    elif page == 'blank':
      return ('text/plain',[])