From bd8a1b8d460d6857ea8c9ab8544550492ba82cc8 Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Fri, 19 Jun 2020 19:20:58 +0800 Subject: Separate config from consts --- git-gmi/config.py | 3 +++ git-gmi/const.py | 3 --- git-gmi/gateway.py | 1 + git-gmi/git.py | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 git-gmi/config.py (limited to 'git-gmi') diff --git a/git-gmi/config.py b/git-gmi/config.py new file mode 100644 index 0000000..f136b8e --- /dev/null +++ b/git-gmi/config.py @@ -0,0 +1,3 @@ +GIT_CATALOG = "/home/fakefred/p/gemini/repos/" +CGI_PATH = "/git/cgi/" +GIT_GMI_SITE_TITLE = "git.gmi demo instance" diff --git a/git-gmi/const.py b/git-gmi/const.py index dcf97b1..11445c6 100644 --- a/git-gmi/const.py +++ b/git-gmi/const.py @@ -1,6 +1,3 @@ -GIT_CATALOG = "/home/fakefred/p/gemini/repos/" -CGI_PATH = "/git/cgi/" -GIT_GMI_SITE_TITLE = "git.gmi demo instance" STATUS_SUCCESS = "20" STATUS_NOT_FOUND = "51 NOT FOUND" STATUS_TEMPORARY_FAILURE = "40 TEMPORARY FAILURE" diff --git a/git-gmi/gateway.py b/git-gmi/gateway.py index 0ae963f..7de077e 100644 --- a/git-gmi/gateway.py +++ b/git-gmi/gateway.py @@ -1,5 +1,6 @@ from git import * from const import * +from config import * from os import environ, listdir # be careful when using print(); stdout is passed to the client. diff --git a/git-gmi/git.py b/git-gmi/git.py index c8fa5c6..a0eb5e0 100644 --- a/git-gmi/git.py +++ b/git-gmi/git.py @@ -2,6 +2,7 @@ from pygit2 import * from hurry.filesize import size, alternative import mimetypes from const import * +from config import * mimetypes.add_type("text/gemini", ".gmi") mimetypes.add_type("text/gemini", ".gemini") -- cgit v1.2.3