Show
Ignore:
Timestamp:
04/12/07 17:38:04 (15 months ago)
Author:
Tarek Ziad?? <tarek@…>
Message:

rupy slides, starting up

Location:
pycommunity
Files:
11 modified

Legend:

Unmodified
Added
Removed
  • pycommunity/pycommunity/doc/configuration.txt

    r68 r78  
    77 
    88    >>> from configuration import Configuration 
    9     >>> config = Configuration('pycommunity.conf') 
     9    >>> config = Configuration('tests/pycommunity.conf') 
    1010 
    1111packages, recipes, and tutorials folders can be read with  
     
    1919    [('tuts', 'tests/svn/project/tutorials')]  
    2020    >>> config.glossary 
    21     'tests/svn/project/doc/glossary.txt' 
     21    '/etc/pycommunity/glossary.txt' 
    2222    >>> packages = config.packages.items() 
    2323    >>> packages.sort() 
     
    2929    >>> templates.sort() 
    3030    >>> templates 
    31     [('css', 'templates/pycommunity.css'),  
    32      ('glossary', 'templates/glossary.pt'),  
    33      ('index', 'templates/index.pt'),  
    34      ('js', 'templates/pycommunity.js'), 
    35      ('packagedoc', 'templates/packagedoc.pt'),  
    36      ('packageindex', 'templates/packageindex.pt'),  
    37      ('packagesindex', 'templates/packagesindex.pt'),  
    38      ('packagestats', 'templates/packagestats.pt'),  
    39      ('recipe', 'templates/recipe.pt'),  
    40      ('recipelist', 'templates/recipelist.pt'),  
    41      ('tutorial', 'templates/tutorial.pt'),  
    42      ('tutoriallist', 'templates/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')]     
    4343    >>> config.media 
    44     'templates/media' 
     44    'tests/templates/media' 
    4545    >>> 'projectname' in config.options 
    4646    True 
  • pycommunity/pycommunity/doc/index.txt

    r68 r78  
    99    >>> options = {'projectname': 'PyCommunity', 
    1010    ...            'index': 'tests/svn/project/doc/README.txt'} 
    11     >>> view = IndexView('templates/index.pt', options) 
     11    >>> view = IndexView('tests/templates/index.pt', options) 
    1212    >>> print view() 
    1313    <html> 
     
    2222    >>> class Conf(object): 
    2323    ...     targets = {'target1': 'tests/www'} 
    24     ...     templates = {'index': 'templates/index.pt',  
    25     ...                  'css': 'templates/pycommunity.css', 
    26     ...                  'js': 'templates/pycommunity.js'} 
    27     ...     media = 'templates/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' 
    2828    ...     options = {'projectname': 'PyCommunity', 
    2929    ...                'index': 'tests/svn/project/doc/README.txt'} 
  • pycommunity/pycommunity/doc/package.txt

    r68 r78  
    1919    ...     targets = {'target1': 'tests/www'} 
    2020    ...     glossary = 'tests/svn/project/doc/glossary.txt' 
     21    ...     tutorials = {'recipes': 'tests/svn/project/tutorials'}     
     22    ...     recipes = {'recipes': 'tests/svn/project/recipes'}    
    2123    ...     packages = {'package1': 'tests/svn/project/src/package1', 
    2224    ...                 'package2': 'tests/svn/project/src/package2' } 
    2325    ...     options = {'projectname': 'PyCommunity', 
    2426    ...                 'packages': 'tests/svn/project/doc/packages.txt'} 
    25     ...     templates = {'packageindex': 'templates/packageindex.pt', 
    26     ...                  'packagesindex': 'templates/packagesindex.pt', 
    27     ...                  'packagestats': 'templates/packagestats.pt', 
    28     ...                  'packagedoc': 'templates/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'} 
    2931    ... 
    3032 
  • pycommunity/pycommunity/doc/recipe.txt

    r68 r78  
    1212    >>> class Conf(object): 
    1313    ...     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'} 
    1718    ...     glossary = 'tests/svn/project/doc/glossary.txt' 
    1819    ... 
  • pycommunity/pycommunity/doc/resttask.txt

    r68 r78  
    99 
    1010    >>> from resttask import TaskView 
    11     >>> view = TaskView('templates/recipe.pt',  
     11    >>> view = TaskView('tests/templates/recipe.pt',  
    1212    ...                 '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'], []) 
    1415    ... 
    1516    >>> title, content = view() 
  • pycommunity/pycommunity/doc/sitebuilder.txt

    r68 r78  
    77 
    88    >>> from sitebuilder import buildSite 
    9     >>> buildSite() 
     9    >>> buildSite('tests/pycommunity.conf') 
    1010     
    1111Checking the structure:: 
  • pycommunity/pycommunity/doc/tutorial.txt

    r68 r78  
    1212    >>> class Conf(object): 
    1313    ...     targets = {'tutorial1': 'tests/www'} 
     14    ...     recipes = {} 
    1415    ...     tutorials = {'tutorials': 'tests/svn/project/tutorials'} 
    15     ...     templates = {'tutorial': 'templates/tutorial.pt', 
    16     ...                  'tutoriallist': 'templates/tutoriallist.pt'} 
     16    ...     templates = {'tutorial': 'tests/templates/tutorial.pt', 
     17    ...                  'tutoriallist': 'tests/templates/tutoriallist.pt'} 
    1718    ...     glossary = 'tests/svn/project/doc/glossary.txt' 
    1819    ... 
  • pycommunity/pycommunity/package.py

    r68 r78  
    158158        self._glossary_file = configuration.glossary 
    159159        self._options = configuration.options 
     160        self._tutorials = configuration.tutorials 
     161        self._recipes = configuration.recipes 
    160162 
    161163        for target in targets: 
     
    199201        template = self._rest_template 
    200202        glossary = self._glossary_file 
     203        tutorials = self._tutorials 
     204        recipes = self._recipes 
    201205 
    202206        for file_ in files: 
    203             view = TaskView(template, file_, glossary) 
     207            view = TaskView(template, file_, glossary, tutorials, recipes) 
    204208            filename = os.path.join(folder, self._getHTMLName(file_)) 
    205209            self._writeFile(filename, view()[1]) 
  • pycommunity/pycommunity/resttask.py

    r68 r78  
    3131class TaskView(object): 
    3232    """generates a base view""" 
    33     def __init__(self, templatefile, restfile, glossaryfile): 
     33    def __init__(self, templatefile, restfile, glossaryfile, tutorial_folders, 
     34                 recipe_folders): 
    3435        title, content = rest2Web(restfile) 
    35         content = linkChecker(content, glossaryfile) 
     36        content = linkChecker(content, glossaryfile, tutorial_folders, 
     37                              recipe_folders) 
    3638        self.title = title 
    3739        self._template = Template(open(templatefile).read(), 
     
    98100                    # generating the view 
    99101                    view = TaskView(self._getTemplateFile(configuration), 
    100                                     restfile, configuration.glossary) 
     102                                    restfile, configuration.glossary, 
     103                                    configuration.tutorials, 
     104                                    configuration.recipes) 
    101105                    title, result = view() 
    102106                    titles.append(title) 
  • pycommunity/pycommunity/utils.py

    r68 r78  
    8989        return None 
    9090 
    91 def _grabContent(type, name): 
     91def _grabContent(type, name, tutorial_folders, recipe_folders): 
    9292    """gets a recipe or a turotial content""" 
    9393    return """<b>Soon</b>""" 
    9494 
    95 def linkChecker(content, glossaryfile): 
     95def linkChecker(content, glossaryfile, tutorial_folders, recipe_folders): 
    9696    """changes links on the fly""" 
    9797    glossary = GlossaryReader(glossaryfile) 
     
    112112        if 'recipe' in match.group(): 
    113113            link = '../recipes/%s.html' % name 
    114             content = _grabContent('recipes', name) 
     114            content = _grabContent('recipes', name, tutorial_folders, 
     115                                   recipe_folders) 
    115116        else: 
    116117            link = '../tutorials/%s.html' % name 
    117             content = _grabContent('tutorials', name) 
     118            content = _grabContent('tutorials', name, tutorial_folders, 
     119                                   recipe_folders) 
    118120 
    119121        url = re_docs[1] 
  • pycommunity/setup.py

    r77 r78  
    6767      maintainer_email="tarek@ziade.org", 
    6868      url = url, 
    69       download_url = '%s/PyCommunity-0.1a-py2.5.egg' % url, 
     69      #download_url = '%s/PyCommunity-0.1a-py2.5.egg' % url, 
    7070      license = "http://www.gnu.org/copyleft/gpl.html", 
    7171      platforms = ["any"],