Mercurial > hg > bitsyblog
changeset 95:dd4abe56edf7
more stubbing; lord how crufty
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 25 Apr 2013 17:13:07 -0700 |
parents | fa221a2d24d9 |
children | c29d58e79fc6 |
files | bitsyblog/cli.py bitsyblog/user.py |
diffstat | 2 files changed, 28 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/bitsyblog/cli.py Wed Apr 24 09:07:15 2013 -0700 +++ b/bitsyblog/cli.py Thu Apr 25 17:13:07 2013 -0700 @@ -3,3 +3,26 @@ """ command line interface to bitsyblog """ + +import optparse +import sys +from user import FilespaceUsers + +def main(args=sys.argv[1:]): + """command line entry point for user creation""" + + # command line parser + usage = '%prog [options] directory user' + parser = optparse.OptionParser(usage=usage) + options, args = parser.parse_args(args) + + # get user name + if len(args) != 2: + parser.error("directory, user not specified") + directory, name = args + + # create user + users = FilespaceUsers(directory) + +if __name__ == '__main__': + main()
--- a/bitsyblog/user.py Wed Apr 24 09:07:15 2013 -0700 +++ b/bitsyblog/user.py Thu Apr 25 17:13:07 2013 -0700 @@ -1,3 +1,7 @@ +""" +module for bitsyblog users +""" + import os import random import settings @@ -88,7 +92,7 @@ def css(self, user, default): css_dir = self.home(user, 'css') - css_files = [ i for i in os.listdir(css_dir) if i.endswith('.css') ] + css_files = [i for i in os.listdir(css_dir) if i.endswith('.css')] if default: default = '%s.css' % default try: