From 3a0e84add08b0028d4b08728073ddf9945dc3be0 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Sun, 4 Mar 2007 12:33:37 -0800 Subject: added GITWIKI_DIR var and added new knowledge to frontpage --- bn_django/git_wiki/models.py | 12 ++++++------ bn_django/git_wiki/settings.py | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'bn_django/git_wiki') diff --git a/bn_django/git_wiki/models.py b/bn_django/git_wiki/models.py index ae9ef79..060e9d5 100644 --- a/bn_django/git_wiki/models.py +++ b/bn_django/git_wiki/models.py @@ -150,10 +150,10 @@ def fromslug(reqslug): import commands if reqslug == '' or reqslug == '/': - f = open(GITWIKI_BASE + '/HEAD','r') + f = open(GITWIKI_DIR + '/HEAD','r') head = f.readline().strip().split()[1] f.close() - f = open(GITWIKI_BASE + '/'+head,'r') + f = open(GITWIKI_DIR + '/'+head,'r') hash = f.readline().strip() f.close() ret = Tree(id=hash) @@ -198,13 +198,13 @@ def fromslug(reqslug): def reposcan(): import os heads = dict() - for h in os.listdir(GITWIKI_BASE + '/refs/heads/'): - f = open(GITWIKI_BASE + '/refs/heads/' + h,'r') + for h in os.listdir(GITWIKI_DIR + '/refs/heads/'): + f = open(GITWIKI_DIR + '/refs/heads/' + h,'r') heads[h.strip()] = f.readline().strip() f.close() tags = dict() - for t in os.listdir(GITWIKI_BASE + '/refs/tags/'): - f = open(GITWIKI_BASE + '/refs/tags/' + t,'r') + for t in os.listdir(GITWIKI_DIR + '/refs/tags/'): + f = open(GITWIKI_DIR + '/refs/tags/' + t,'r') tags[t.strip()] = f.readline().strip() f.close() return (heads, tags) diff --git a/bn_django/git_wiki/settings.py b/bn_django/git_wiki/settings.py index ed07f53..965ac26 100644 --- a/bn_django/git_wiki/settings.py +++ b/bn_django/git_wiki/settings.py @@ -9,5 +9,6 @@ GITWIKI_NAME = '' # fill path to the git command GITCOMMAND = '/usr/local/bin/git' +GITWIKI_DIR = str(GITWIKI_BASE) + '/' + str(GITWIKI_NAME) + '.git' GITPREFIX = 'cd ' +str(GITWIKI_BASE) + '; ' + str(GITCOMMAND) + ' --git-dir=' \ - + str(GITWIKI_BASE) + '/' + GITWIKI_NAME + '.git' + + str(GITWIKI_DIR) -- cgit v1.2.3