Skip to content

Commit

Permalink
adding configs
Browse files Browse the repository at this point in the history
  • Loading branch information
aconbere committed Sep 2, 2009
1 parent 4471f33 commit 503adc6
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 4 deletions.
Empty file added config/apache.vhost
Empty file.
Empty file added config/lighttpd.vhost
Empty file.
Empty file added config/nginx.vhost
Empty file.
10 changes: 9 additions & 1 deletion igor/tools.py
Expand Up @@ -7,6 +7,7 @@
from config import Config
from publisher import Publisher
from utils import hidden, relpath, list_dirs, list_files, copy_tree, copy_file
from vcs import
import markup

import template_tools
Expand All @@ -33,7 +34,14 @@ def make_posts(start_path, prefix, extensions=[".txt"]):
and returns each file to the Post class
"""
posts_path = path.join(start_path, prefix)
return [Post(p, start_path) for p in find_files(posts_path, extensions)]
vcs_cls = get_vcs(vcs_type(start_path))

def make_post(f):
text_file = TextFile(f)
vcs = vcs_cls(start_path, f)
return Post(text_file, vcs)

return [make_post(f) for f in find_files(posts_path, extensions)]

def copy_supporting_files(start_path, destination):
for file in list_files(start_path):
Expand Down
1 change: 1 addition & 0 deletions igor/vcs/__init__.py
@@ -0,0 +1 @@
from vcs import vcs_type, get_vcs
7 changes: 5 additions & 2 deletions igor/vcs/git/__init__.py
@@ -1,10 +1,13 @@
from log import Log

class Git(object):
def __init__(self, project_path, file_path)
self.project_path = project_path
self.git_log = Log(self.project_path, relpath(self.ref, self.project_path)).call()
self.file_path = file_path
self.git_log = Log(self.project_path, relpath(self.file_path, self.project_path)).call()

def published_date():
pass
return self.git_log.headers['author'].datetime

def author():
return self.git_log.headers['author'].name
Expand Down
14 changes: 14 additions & 0 deletions igor/vcs/vcs.py
Expand Up @@ -24,4 +24,18 @@ def get_vcs(type):
def register(type, cls):
systems[type] = cls

class BaseVCS(object):
def __init__(self, project_path, file_path):
self.project_path = project_path
self.file_path = file_path

def publish_date():
raise Exception("publish_date not implimented")

def author():
raise Exception("publish_date not implimented")

def author_email():
raise Exception("publish_date not implimented")

register("git", Git)
3 changes: 2 additions & 1 deletion setup.py
Expand Up @@ -5,6 +5,7 @@
author="Anders Conbere",
author_email = "aconbere@conbere.org",
license = "bsd",
packages=["igor", "igor.git"],
packages=["igor", "igor.vcs", "igor.vcs.git", "igor.vcs.hg"],
package_data=["examples/init/*", "config/*.vhost"],
scripts=["scripts/igor", "scripts/igor-post-update"]
)

0 comments on commit 503adc6

Please sign in to comment.