Changeset 78:b5dabe9762d1 for pycommunity
- Timestamp:
- 04/12/07 17:38:04 (15 months ago)
- Location:
- pycommunity
- Files:
-
- 11 modified
-
pycommunity/doc/configuration.txt (modified) (3 diffs)
-
pycommunity/doc/index.txt (modified) (2 diffs)
-
pycommunity/doc/package.txt (modified) (1 diff)
-
pycommunity/doc/recipe.txt (modified) (1 diff)
-
pycommunity/doc/resttask.txt (modified) (1 diff)
-
pycommunity/doc/sitebuilder.txt (modified) (1 diff)
-
pycommunity/doc/tutorial.txt (modified) (1 diff)
-
pycommunity/package.py (modified) (2 diffs)
-
pycommunity/resttask.py (modified) (2 diffs)
-
pycommunity/utils.py (modified) (2 diffs)
-
setup.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
pycommunity/pycommunity/doc/configuration.txt
r68 r78 7 7 8 8 >>> from configuration import Configuration 9 >>> config = Configuration(' pycommunity.conf')9 >>> config = Configuration('tests/pycommunity.conf') 10 10 11 11 packages, recipes, and tutorials folders can be read with … … 19 19 [('tuts', 'tests/svn/project/tutorials')] 20 20 >>> config.glossary 21 ' tests/svn/project/doc/glossary.txt'21 '/etc/pycommunity/glossary.txt' 22 22 >>> packages = config.packages.items() 23 23 >>> packages.sort() … … 29 29 >>> templates.sort() 30 30 >>> templates 31 [('css', 'te mplates/pycommunity.css'),32 ('glossary', 'te mplates/glossary.pt'),33 ('index', 'te mplates/index.pt'),34 ('js', 'te mplates/pycommunity.js'),35 ('packagedoc', 'te mplates/packagedoc.pt'),36 ('packageindex', 'te mplates/packageindex.pt'),37 ('packagesindex', 'te mplates/packagesindex.pt'),38 ('packagestats', 'te mplates/packagestats.pt'),39 ('recipe', 'te mplates/recipe.pt'),40 ('recipelist', 'te mplates/recipelist.pt'),41 ('tutorial', 'te mplates/tutorial.pt'),42 ('tutoriallist', 'te mplates/tutoriallist.pt')]31 [('css', 'tests/templates/pycommunity.css'), 32 ('glossary', 'tests/templates/glossary.pt'), 33 ('index', 'tests/templates/index.pt'), 34 ('js', 'tests/templates/pycommunity.js'), 35 ('packagedoc', 'tests/templates/packagedoc.pt'), 36 ('packageindex', 'tests/templates/packageindex.pt'), 37 ('packagesindex', 'tests/templates/packagesindex.pt'), 38 ('packagestats', 'tests/templates/packagestats.pt'), 39 ('recipe', 'tests/templates/recipe.pt'), 40 ('recipelist', 'tests/templates/recipelist.pt'), 41 ('tutorial', 'tests/templates/tutorial.pt'), 42 ('tutoriallist', 'tests/templates/tutoriallist.pt')] 43 43 >>> config.media 44 'te mplates/media'44 'tests/templates/media' 45 45 >>> 'projectname' in config.options 46 46 True -
pycommunity/pycommunity/doc/index.txt
r68 r78 9 9 >>> options = {'projectname': 'PyCommunity', 10 10 ... 'index': 'tests/svn/project/doc/README.txt'} 11 >>> view = IndexView('te mplates/index.pt', options)11 >>> view = IndexView('tests/templates/index.pt', options) 12 12 >>> print view() 13 13 <html> … … 22 22 >>> class Conf(object): 23 23 ... targets = {'target1': 'tests/www'} 24 ... templates = {'index': 'te mplates/index.pt',25 ... 'css': 'te mplates/pycommunity.css',26 ... 'js': 'te mplates/pycommunity.js'}27 ... media = 'te mplates/media'24 ... templates = {'index': 'tests/templates/index.pt', 25 ... 'css': 'tests/templates/pycommunity.css', 26 ... 'js': 'tests/templates/pycommunity.js'} 27 ... media = 'tests/templates/media' 28 28 ... options = {'projectname': 'PyCommunity', 29 29 ... 'index': 'tests/svn/project/doc/README.txt'} -
pycommunity/pycommunity/doc/package.txt
r68 r78 19 19 ... targets = {'target1': 'tests/www'} 20 20 ... glossary = 'tests/svn/project/doc/glossary.txt' 21 ... tutorials = {'recipes': 'tests/svn/project/tutorials'} 22 ... recipes = {'recipes': 'tests/svn/project/recipes'} 21 23 ... packages = {'package1': 'tests/svn/project/src/package1', 22 24 ... 'package2': 'tests/svn/project/src/package2' } 23 25 ... options = {'projectname': 'PyCommunity', 24 26 ... 'packages': 'tests/svn/project/doc/packages.txt'} 25 ... templates = {'packageindex': 'te mplates/packageindex.pt',26 ... 'packagesindex': 'te mplates/packagesindex.pt',27 ... 'packagestats': 'te mplates/packagestats.pt',28 ... 'packagedoc': 'te mplates/packagedoc.pt'}27 ... templates = {'packageindex': 'tests/templates/packageindex.pt', 28 ... 'packagesindex': 'tests/templates/packagesindex.pt', 29 ... 'packagestats': 'tests/templates/packagestats.pt', 30 ... 'packagedoc': 'tests/templates/packagedoc.pt'} 29 31 ... 30 32 -
pycommunity/pycommunity/doc/recipe.txt
r68 r78 12 12 >>> class Conf(object): 13 13 ... targets = {'target1': 'tests/www'} 14 ... recipes = {'recipes': 'tests/svn/project/recipes'} 15 ... templates = {'recipe': 'templates/recipe.pt', 16 ... 'recipelist': 'templates/recipelist.pt'} 14 ... tutorials = {'recipes': 'tests/svn/project/tutorials'} 15 ... recipes = {'recipes': 'tests/svn/project/recipes'} 16 ... templates = {'recipe': 'tests/templates/recipe.pt', 17 ... 'recipelist': 'tests/templates/recipelist.pt'} 17 18 ... glossary = 'tests/svn/project/doc/glossary.txt' 18 19 ... -
pycommunity/pycommunity/doc/resttask.txt
r68 r78 9 9 10 10 >>> from resttask import TaskView 11 >>> view = TaskView('te mplates/recipe.pt',11 >>> view = TaskView('tests/templates/recipe.pt', 12 12 ... 'tests/svn/project/recipes/glossary_recipe.txt', 13 ... 'tests/svn/project/doc/glossary.txt') 13 ... 'tests/svn/project/doc/glossary.txt', 14 ... ['tests/svn/project/doc/tutorials'], []) 14 15 ... 15 16 >>> title, content = view() -
pycommunity/pycommunity/doc/sitebuilder.txt
r68 r78 7 7 8 8 >>> from sitebuilder import buildSite 9 >>> buildSite( )9 >>> buildSite('tests/pycommunity.conf') 10 10 11 11 Checking the structure:: -
pycommunity/pycommunity/doc/tutorial.txt
r68 r78 12 12 >>> class Conf(object): 13 13 ... targets = {'tutorial1': 'tests/www'} 14 ... recipes = {} 14 15 ... tutorials = {'tutorials': 'tests/svn/project/tutorials'} 15 ... templates = {'tutorial': 'te mplates/tutorial.pt',16 ... 'tutoriallist': 'te mplates/tutoriallist.pt'}16 ... templates = {'tutorial': 'tests/templates/tutorial.pt', 17 ... 'tutoriallist': 'tests/templates/tutoriallist.pt'} 17 18 ... glossary = 'tests/svn/project/doc/glossary.txt' 18 19 ... -
pycommunity/pycommunity/package.py
r68 r78 158 158 self._glossary_file = configuration.glossary 159 159 self._options = configuration.options 160 self._tutorials = configuration.tutorials 161 self._recipes = configuration.recipes 160 162 161 163 for target in targets: … … 199 201 template = self._rest_template 200 202 glossary = self._glossary_file 203 tutorials = self._tutorials 204 recipes = self._recipes 201 205 202 206 for file_ in files: 203 view = TaskView(template, file_, glossary )207 view = TaskView(template, file_, glossary, tutorials, recipes) 204 208 filename = os.path.join(folder, self._getHTMLName(file_)) 205 209 self._writeFile(filename, view()[1]) -
pycommunity/pycommunity/resttask.py
r68 r78 31 31 class TaskView(object): 32 32 """generates a base view""" 33 def __init__(self, templatefile, restfile, glossaryfile): 33 def __init__(self, templatefile, restfile, glossaryfile, tutorial_folders, 34 recipe_folders): 34 35 title, content = rest2Web(restfile) 35 content = linkChecker(content, glossaryfile) 36 content = linkChecker(content, glossaryfile, tutorial_folders, 37 recipe_folders) 36 38 self.title = title 37 39 self._template = Template(open(templatefile).read(), … … 98 100 # generating the view 99 101 view = TaskView(self._getTemplateFile(configuration), 100 restfile, configuration.glossary) 102 restfile, configuration.glossary, 103 configuration.tutorials, 104 configuration.recipes) 101 105 title, result = view() 102 106 titles.append(title) -
pycommunity/pycommunity/utils.py
r68 r78 89 89 return None 90 90 91 def _grabContent(type, name ):91 def _grabContent(type, name, tutorial_folders, recipe_folders): 92 92 """gets a recipe or a turotial content""" 93 93 return """<b>Soon</b>""" 94 94 95 def linkChecker(content, glossaryfile ):95 def linkChecker(content, glossaryfile, tutorial_folders, recipe_folders): 96 96 """changes links on the fly""" 97 97 glossary = GlossaryReader(glossaryfile) … … 112 112 if 'recipe' in match.group(): 113 113 link = '../recipes/%s.html' % name 114 content = _grabContent('recipes', name) 114 content = _grabContent('recipes', name, tutorial_folders, 115 recipe_folders) 115 116 else: 116 117 link = '../tutorials/%s.html' % name 117 content = _grabContent('tutorials', name) 118 content = _grabContent('tutorials', name, tutorial_folders, 119 recipe_folders) 118 120 119 121 url = re_docs[1] -
pycommunity/setup.py
r77 r78 67 67 maintainer_email="tarek@ziade.org", 68 68 url = url, 69 download_url = '%s/PyCommunity-0.1a-py2.5.egg' % url,69 #download_url = '%s/PyCommunity-0.1a-py2.5.egg' % url, 70 70 license = "http://www.gnu.org/copyleft/gpl.html", 71 71 platforms = ["any"],
