GithubHelp home page GithubHelp logo

chasha's Introduction

Overview

чаша means "cup" in Bulgarian, and is a play on the larger Python Web Frameworks such as Bottle and Flask. However, instead of targetting the WWW, Chasha targets the Gopher protocol; it includes simple classes for handling Routes, Directories, Images & the like.

Rationale

Why not? We have Lamson for route-oriented SMTP, and Bottle/Flask/... for Web, may as well have one (or more!) for Gopher.

Addtionally, this allows me to create a non-Digamma reference implementation for some extensions I was thinking of for Gopher+

Example

The repository contains several example files, but the simplest example is the following:

from chasha import Chasha, Directory


app = Chasha()


@app.route('/test/<bar:int>')
def test(bar):
    return "bar is {0}".format(bar)


@app.default()
def main():
    d = Directory()
    d.add_child("Information lines are simply text in directories")
    d.add_child("atm, multiline must be manually split")
    d.add_child([0, 'Test 10', '/test/10', '127.0.0.1', '7070'])
    d.add_text('Test 20', '/test/20') # less manual version of the above
    d.add_child("And of course, you can mix info, links, &c.")

app.run()

Protocol Support

Currently support:

  • descriptors
  • Directories via class, all others as Helper methods on Directory class
  • search strings

Planned Support

  • full Gopher RFC
  • Gopher+ draft
  • Extensions as a "Gopher*" protocol

To Do

DONE: The biggest thing I'd like to do is reduce the amount of manual work that has to be done in directories. A helper method in the Chasha object, such as Chasha#make_link or even on the Directory class, to reduce the need for manual lists. (Actually, thinking about it, I like it on the Directory class more...). Directory#add_URL, #add_image, #add_directory all make it a bit easier, without having to add multiple classes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.