summaryrefslogtreecommitdiff
path: root/git-gmi
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@macaw.me>2020-06-19 19:20:58 +0800
committerFrederick Yin <fkfd@macaw.me>2020-06-19 19:20:58 +0800
commitbd8a1b8d460d6857ea8c9ab8544550492ba82cc8 (patch)
treee269e7773bf290147c0cf2fc615a851fbf938f59 /git-gmi
parent4110a4df25170289dce8690a572d26c58063adb9 (diff)
Separate config from consts
Diffstat (limited to 'git-gmi')
-rw-r--r--git-gmi/config.py3
-rw-r--r--git-gmi/const.py3
-rw-r--r--git-gmi/gateway.py1
-rw-r--r--git-gmi/git.py1
4 files changed, 5 insertions, 3 deletions
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")