From 71520ba4e171195c983320b9c00e37c215fad39c Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Sat, 24 Feb 2007 21:38:38 -0800 Subject: i'm confused? --- bn_django/git_wiki/models.py | 12 ++++++------ bn_django/git_wiki/settings.py | 6 +++--- bn_django/git_wiki/templates/git_wiki/base.html | 5 ++++- bn_django/git_wiki/templates/git_wiki/item.html | 4 ---- 4 files changed, 13 insertions(+), 14 deletions(-) (limited to 'bn_django/git_wiki') diff --git a/bn_django/git_wiki/models.py b/bn_django/git_wiki/models.py index 11f00f1..0e71fca 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 + '/.git/HEAD','r') + f = open(GITWIKI_BASE + '/' + GITWIKI_NAME + '.git/HEAD','r') head = f.readline().strip().split()[1] f.close() - f = open(GITWIKI_BASE + '/.git/'+head,'r') + f = open(GITWIKI_BASE + '/' + GITWIKI_NAME + '.git/'+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 + '/.git/refs/heads/'): - f = open(GITWIKI_BASE + '/.git/refs/heads/' + h,'r') + for h in os.listdir(GITWIKI_BASE + '/' + GITWIKI_NAME + '.git/refs/heads/'): + f = open(GITWIKI_BASE + '/' + GITWIKI_NAME + '.git/refs/heads/' + h,'r') heads[h.strip()] = f.readline().strip() f.close() tags = dict() - for t in os.listdir(GITWIKI_BASE + '/.git/refs/tags/'): - f = open(GITWIKI_BASE + '/.git/refs/tags/' + t,'r') + for t in os.listdir(GITWIKI_BASE + '/' + GITWIKI_NAME + '.git/refs/tags/'): + f = open(GITWIKI_BASE + '/' + GITWIKI_NAME + '.git/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..fb81e26 100644 --- a/bn_django/git_wiki/settings.py +++ b/bn_django/git_wiki/settings.py @@ -1,13 +1,13 @@ # full path to directory holding the wiki repository (or sys links to # the repositories) -GITWIKI_BASE = '/home/bnewbold/knowledge/' +GITWIKI_BASE = '/srv/git/' # leave this blank (NO WHITE SPACE) unless you're using a bare repo -GITWIKI_NAME = '' +GITWIKI_NAME = 'knowledge' # fill path to the git command -GITCOMMAND = '/usr/local/bin/git' +GITCOMMAND = '/usr/bin/git' GITPREFIX = 'cd ' +str(GITWIKI_BASE) + '; ' + str(GITCOMMAND) + ' --git-dir=' \ + str(GITWIKI_BASE) + '/' + GITWIKI_NAME + '.git' diff --git a/bn_django/git_wiki/templates/git_wiki/base.html b/bn_django/git_wiki/templates/git_wiki/base.html index eefaa9a..ded3c25 100644 --- a/bn_django/git_wiki/templates/git_wiki/base.html +++ b/bn_django/git_wiki/templates/git_wiki/base.html @@ -4,13 +4,16 @@ {{ block.super }} - + {% endblock %} {% block path %} {{ block.super }} knowledge +{% if item %} + » {{ object.title }} +{% endif %} {% endblock %} {% block title %} diff --git a/bn_django/git_wiki/templates/git_wiki/item.html b/bn_django/git_wiki/templates/git_wiki/item.html index 7562fc6..0df1b72 100644 --- a/bn_django/git_wiki/templates/git_wiki/item.html +++ b/bn_django/git_wiki/templates/git_wiki/item.html @@ -1,15 +1,11 @@ {% extends "git_wiki/base.html" %} -{% load markup %} - {% block path %}{{ block.super }} » {{ item.path }}{% endblock %} {% block title %}Knowledge Item: {{ item.path }}{% endblock %} {% block gitwiki %} - {{ item.contents|restructuredtext }} -

Item name:

{{ item.name }}

Item sha1 hash:

-- cgit v1.2.3