Antti Kaihola avatar Antti Kaihola committed 07bb625 Merge

Merging...

Comments (0)

Files changed (53)

+Jordi Bofill - Tinkerer internationalization, Spanish and Catalan translations
+Yoshihisa Tanaka - Fixed problem caused by non-ascii content
 
 FreeBSD license:
 
-Copyright (c) 2011 by Vlad Riscutia. 
+Copyright (c) 2011-2012 by Vlad Riscutia and contributors. 
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without modification, are
 include LICENSE
+include CONTRIBUTORS
 
 recursive-include tinkerer/__templates *
 recursive-include tinkerer/themes *
 recursive-include tinkerer/templates *
 recursive-include tinkerer/static *
+recursive-include tinkerer/ext/locale *.mo

blog/doc/additional_extensions.rst

 There are two options for managing comments: using a user ID or an app ID.
 
 .. highlight:: html
+
 User Admin
 ~~~~~~~~~~
 
 
 Make sure to replace ``$(YOUR_APP_ID)`` above with the appropriate ID.
 
+.. note::
+    Unlike Disqus, Facebook comment box does not inherit the blog theme style.
+    Tinkerer will not provide any styling for the comment box.
+
 Back to :ref:`tinkerer_reference`.

blog/doc/more_tinkering.rst

 More information on extending templates can be found in the
 `Sphinx documentation <http://sphinx.pocoo.org/templating.html#script_files>`_.
 
+Localization
+------------
+
+.. highlight:: python
+
+By default, Tinkerer is built using English language. Tinkerer is currently 
+localized in Spanish and Catalan. To change localization, add the following 
+line to your ``conf.py`` for Spanish::
+
+   language = "es"
+   
+or for Catalan::
+
+   language = "ca"
+
+.. highlight:: html
+
 RSS
 ---
 
 
     Package setup script.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 from setuptools import setup, find_packages
             "tinker = tinkerer.cmdline:main"
         ]
     },
-    install_requires=requires
+    install_requires = requires
 )

tinkerer/__init__.py

 
     Blogging with Sphinx. Like a boss.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
-__version__ = "0.2.1b"
+__version__ = "0.3.1b"
 
 master_doc = "master"
 source_suffix = ".rst"

tinkerer/cmdline.py

     post - to create a new post
     page - to create a new page
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import argparse

tinkerer/draft.py

 
     Handles creating drafts.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENCE file
 '''
 import os

tinkerer/ext/__init__.py

 
     Blogging extensions.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 

tinkerer/ext/aggregator.py

 
     Aggregates multiple posts into single pages.
 
-    :copyright: Copyright 2011 by Vlad Riscutia.
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import copy
             # first page doesn't have prev link and its title is "Home"
             pagename = "index"
             context["prev"] = None
-            context["title"] = "Home"
+            context["title"] = _("Home")
         else:
             # following pages prev-link to previous page (titled as "Newer")
             pagename = "page%d" % i
-            context["prev"]["title"] = "Newer"
+            context["prev"]["title"] = _("Newer")
             context["prev"]["link"] = "index.html" if i == 1 else "page%d.html" % (i - 1)
-            context["title"] = "Page %d" % (i + 1)
+            context["title"] = _("Page %d") % (i + 1)
 
         if i == len(groups) - 1:
             # last page doesn't have next link
             context["next"] = None
         else:
             # other pages next-link to following page (titled as "Older")
-            context["next"]["title"] = "Older"
+            context["next"]["title"] = _("Older")
             context["next"]["link"] = "page%d.html" % (i + 1)
 
         yield (pagename, context, "aggregated.html")

tinkerer/ext/author.py

 
     Post author extension.
 
-    :copyright: Copyright 2011 by Vlad Riscutia.
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 from sphinx.util.compat import Directive

tinkerer/ext/blog.py

 
     Master blog extension.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 from tinkerer.ext import aggregator, author, filing, metadata, rss 
+import gettext
 
 
 
     metadata.initialize(app)
     filing.initialize(app)
 
+    lang = app.config.language if app.config.language else ""
 
+    locale_dir = ""
+    try:
+        from pkg_resources import resource_filename
+    except ImportError:
+        resource_filename = None
+
+    if resource_filename is not None:
+        try:
+            locale_dir = resource_filename(__name__, "/locale")
+        except NotImplementedError:
+            # resource_filename doesn't work with non-egg zip files
+            pass
+
+    app.t = gettext.translation(
+                    "tinkerer",
+                    locale_dir,
+                    languages=[lang],
+                    fallback=True)
+    _ = app.t.gettext
+    app.t.install()
 
 def source_read(app, docname, source):
     '''

tinkerer/ext/disqus.py

     Handler for `comments` directive using Disqus.
     Disqus shortname must be provided in `conf.py` as `disqus_shortname`.
     
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 from sphinx.util.compat import Directive

tinkerer/ext/fbcomments.py

 
     Handler for `comments` directive using Facebook Comment Box.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 from sphinx.util.compat import Directive

tinkerer/ext/filing.py

 
     Handles post filing by date, caregories and tags.
 
-    :copyright: Copyright 2011 by Vlad Riscutia.
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 from sphinx.util.compat import Directive
     '''
     Generates blog archive including all posts.
     '''
-    yield make_archive_page(app.builder.env, "Blog Archive", "archive") 
+    yield make_archive_page(app.builder.env, _("Blog Archive"), "archive") 
 
 
 
     env = app.builder.env
     for tag in env.filing["tags"]:
         yield make_archive_page(env,
-                'Posts tagged with <span class="title_tag">%s</span>' % tag,
+                _('Posts tagged with <span class="title_tag">%s</span>') % tag,
                 "tags/" + utils.name_from_title(tag),
                 lambda post: post in env.filing["tags"][tag])
 
     env = app.builder.env
     for category in env.filing["categories"]:
         yield make_archive_page(env,
-                'Filed under <span class="title_category">%s</span>' % category,
+                _('Filed under <span class="title_category">%s</span>') % category,
                 "categories/" + utils.name_from_title(category),
                 lambda post: post in env.filing["categories"][category])
 
Add a comment to this file

tinkerer/ext/locale/ca/LC_MESSAGES/tinkerer.mo

Binary file added.

tinkerer/ext/locale/ca/LC_MESSAGES/tinkerer.pot

+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR ORGANIZATION
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2012-01-23 11:21+CET\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: ENCODING\n"
+"Generated-By: pygettext.py 1.5\n"
+
+
+#: ./ext/aggregator.py:50 ./ext/metadata.py:118 ./ext/metadata.py:134
+msgid "Home"
+msgstr "Inici"
+
+#: ./ext/aggregator.py:54
+msgid "Newer"
+msgstr "Més nou"
+
+#: ./ext/aggregator.py:56
+msgid "Page %d"
+msgstr "Pàgina %d"
+
+#: ./ext/aggregator.py:63
+msgid "Older"
+msgstr "Més antic"
+
+#: ./ext/filing.py:78 ./ext/metadata.py:136
+msgid "Blog Archive"
+msgstr "Arxiu del bloc"
+
+#: ./ext/filing.py:89
+msgid "Posts tagged with <span class=\"title_tag\">%s</span>"
+msgstr "Entrades etiquetades <span class=\"title_tag\">%s</span>"
+
+#: ./ext/filing.py:102
+msgid "Filed under <span class=\"title_category\">%s</span>"
+msgstr "Classificat com <span class=\"title_category\">%s</span>"
+
+#: ./ext/metadata.py:133
+msgid "Recent Posts"
+msgstr "Entrades recents"
+
+#: ./ext/metadata.py:135
+msgid "Posted by"
+msgstr "Entrada de"
+
+#: ./ext/metadata.py:137
+msgid "Filed under"
+msgstr "Classificat com"
+
+#: ./ext/metadata.py:138
+msgid "Tags"
+msgstr "Etiquetes"
+
+#: ./ext/metadata.py:139
+msgid "%B %d, %Y"
+msgstr "%d %B %Y"
+
Add a comment to this file

tinkerer/ext/locale/es/LC_MESSAGES/tinkerer.mo

Binary file added.

tinkerer/ext/locale/es/LC_MESSAGES/tinkerer.pot

+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR ORGANIZATION
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2012-01-23 11:21+CET\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: ENCODING\n"
+"Generated-By: pygettext.py 1.5\n"
+
+
+#: ./ext/aggregator.py:50 ./ext/metadata.py:118 ./ext/metadata.py:134
+msgid "Home"
+msgstr "Inicio"
+
+#: ./ext/aggregator.py:54
+msgid "Newer"
+msgstr "Mas nuevo"
+
+#: ./ext/aggregator.py:56
+msgid "Page %d"
+msgstr "Página %d"
+
+#: ./ext/aggregator.py:63
+msgid "Older"
+msgstr "Mas antiguo"
+
+#: ./ext/filing.py:78 ./ext/metadata.py:136
+msgid "Blog Archive"
+msgstr "Archivo del blog"
+
+#: ./ext/filing.py:89
+msgid "Posts tagged with <span class=\"title_tag\">%s</span>"
+msgstr "Entradas etiquetadas <span class=\"title_tag\">%s</span>"
+
+#: ./ext/filing.py:102
+msgid "Filed under <span class=\"title_category\">%s</span>"
+msgstr "Clasificado como <span class=\"title_category\">%s</span>"
+
+#: ./ext/metadata.py:133
+msgid "Recent Posts"
+msgstr "Entradas recientes"
+
+#: ./ext/metadata.py:135
+msgid "Posted by"
+msgstr "Entrada de"
+
+#: ./ext/metadata.py:137
+msgid "Filed under"
+msgstr "Clasificado como"
+
+#: ./ext/metadata.py:138
+msgid "Tags"
+msgstr "Etiquetas"
+
+#: ./ext/metadata.py:139
+msgid "%B %d, %Y"
+msgstr "%d %B %Y"
+

tinkerer/ext/metadata.py

     Blog metadata extension. The extension extracts and computes metadata 
     associated with blog posts/pages and stores it in the environment.
 
-    :copyright: Copyright 2011 by Vlad Riscutia.
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import re
                 else:
                     env.blog_pages.append(doc)
      
-    env.blog_page_list = [("index", "Home")] + [(page, env.titles[page].astext()) for page in env.blog_pages]
+    env.blog_page_list = [("index", _("Home"))] + [(page, env.titles[page].astext()) for page in env.blog_pages]
 
 
 
     # blog tagline and pages
     context["tagline"] = app.config.tagline
     context["pages"] = env.blog_page_list
+    
+    # set translation context variables
+    context["text_recent_posts"] = _("Recent Posts")
+    context["text_posted_by"] = _("Posted by")
+    context["text_blog_archive"] = _("Blog Archive")
+    context["text_filed_under"] = _("Filed under")
+    context["text_tags"] = _("Tags")
+    context["timestamp_format"] = _('%B %d, %Y')    
 
     # recent posts
     context["recent"] = [(post, env.titles[post].astext()) for post 

tinkerer/ext/patch.py

     generates these links as relative paths - aggregated pages and RSS
     feed require these to be patched.
 
-    :copyright: Copyright 2011 by Vlad Riscutia.
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import xml.dom.minidom
     to fix hyperlinks. Also hyperlinks document title. Returns resulting 
     XML as string.
     '''
-    doc = xml.dom.minidom.parseString(body.encode('utf-8'))
+    doc = xml.dom.minidom.parseString(body.encode("utf-8"))
 
     patch_node(doc, docpath)
 

tinkerer/ext/rss.py

 
     RSS feed generator for blog. 
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import cgi
                 time.mktime(env.blog_metadata[post].date.timetuple()),
                 usegmt=True)
 
+        categories = [category[1] for category in env.blog_metadata[post].filing["categories"]]
+
         context["items"].append({
                     "title": env.titles[post].astext(),
                     "link": link,
                     "description": patch.patch_links(
                             env.blog_metadata[post].body, 
                             app.config.website + post[:11]),
+                    "categories": categories,
                     "pubDate": timestamp
                 })
 

tinkerer/master.py

 
     Handles updating the master document.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 from tinkerer import paths
 
     Handles creating new pages and inserting them in the master document.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import os

tinkerer/paths.py

 
     Tinkerer path information.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import os
 
     Handles creating new posts and inserting them in the master document.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENCE file
 '''
 from datetime import datetime

tinkerer/themes/minimal/layout.html

 
     Layout for Minimal theme.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 #}
 

tinkerer/themes/minimal/static/minimal.css_t

  *
  * Stylesheet for minimal theme.
  *
- * :copyright: Copyright 2011 by Vlad Riscutia
+ * :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+ * CONTRIBUTORS file)
  * :license: FreeBSD, see LICENSE file
  */
 

tinkerer/themes/modern/layout.html

 
     Layout for Modern theme.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 #}
 

tinkerer/themes/modern/static/modern.css_t

  *
  * Stylesheet for modern theme.
  *
- * :copyright: Copyright 2011 by Vlad Riscutia
+ * :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+ * CONTRIBUTORS file)
  * :license: FreeBSD, see LICENSE file
  */
 
     text-decoration: none;
 }
 
-a:hover {
-    text-decoration: underline;
+a h1 {
+    color: black;
 }
 
-a h1 {
-    color: black;
+a:hover, a:hover h1 {
+    text-decoration: underline;
 }
 
 /* Header */
     font-size: 300%;
     margin: 0;
     padding: 12px 48px 0px 48px;
-    text-shadow: 0px 1px 1px #cccccc;
+    text-shadow: 0px 2px 0px black;
 }
 
 div.header a {
     font-style: italic;
     padding: 12px 48px;
     margin: 0;
+    text-shadow: 0px 2px 0px black;
 }
 
 /* Page navigation */
 
 div.page_nav a {
     color: #dddddd;
+    padding: 0 24px;
     text-decoration: none;
+    text-shadow: 0px 2px 1px black;
 }
 
 div.page_nav a:hover {
     display: inline;
 }
 
-div.page_nav a {
-    padding: 0 24px;
-}
-
 div.page_nav li + li {
     border-left: 1px solid #dddddd;
 }
 
-div.page_nav li.right {
+div.page_nav li + li a {
+    border-left: 1px solid black;
+}
+
+div.page_nav li.right, div.page_nav li.right a {
     border: none;
 }
 

tinkerer/themes/tinkerbase/aggregated.html

 
     Front page and following pages aggregating multiple posts per page.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 #}
 
 {% extends "page.html" %}
 
-{%- set archive_title = archive_title is not defined and ' Blog Archive ' or archive_title %}
+{%- set archive_title = archive_title is not defined and text_blog_archive or archive_title %}
 
 {% block body %}
     {{ tinkerer_relbar() }}

tinkerer/themes/tinkerbase/archive.html

 
     Archive page.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 #}
 

tinkerer/themes/tinkerbase/feed/index.html

         <description>{{ description }}</description>
         <language>{{ language }}</language>
         <pubDate>{{ pubDate }}</pubDate>
-        {% for item in items %}
+        {%- for item in items %}
         <item>
             <link>{{ item.link }}</link>
             <guid>{{ item.link }}</guid>
             <title>{{ item.title }}</title>
             <description><![CDATA[{{ item.description }}]]></description>
+            {%- for category in item.categories %}
+            <category><![CDATA[ {{ category }} ]]></category>
+            {%- endfor %}
             <pubDate>{{ item.pubDate }}</pubDate>
         </item>
-    {% endfor %}
+        {%- endfor %}
     </channel>
 </rss>

tinkerer/themes/tinkerbase/layout.html

 
     Master layout template for Tinkerer blog themes.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
-    :license: FreeBSD, see LICENSE file
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
+     :license: FreeBSD, see LICENSE file
 #}
 
 {% extends "basic/layout.html" %}
 {%- macro author(author_name) %}
     {%- if author_name %}
         <div class="author">
-            <span>Posted by {{ author_name }}</span>
+            <span>{{ text_posted_by }} {{ author_name }}</span>
         </div>
     {%- endif %}
 {%- endmacro %}
     {%- if post_categories %}
         <div class="categories">
             <span>
-                Filed under:
+                {{ text_filed_under }}:
                 {% for link, category in post_categories %}
                     <a href="{{ pathto('categories/' + link + '.html', 1) }}">{{ category }}</a>
                     {%- if not loop.last %}, {%- endif %}
     {%- if post_tags %}
         <div class="tags">
             <span>
-                Tags:
+                {{ text_tags }}:
                 {% for link, tag in post_tags %}
                     <a href="{{ pathto('tags/' + link + '.html', 1) }}">{{ tag }}</a>
                     {%- if not loop.last %}, {%- endif %}

tinkerer/themes/tinkerbase/page.html

 
     Master layout for Tinkerer pages.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 #}
 

tinkerer/themes/tinkerbase/recent.html

 
     Sidebar list of recent posts.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 #}
 
 {%- set recent_count = recent_count is not defined and 10 or recent_count %}
 
 <div class="widget">
-    <h3>Recent Posts</h3>
+    <h3>{{ text_recent_posts }}</h3>
     <ul>
         {%- for post, post_title in recent[:recent_count] %}
         <li>

tinkerer/themes/tinkerbase/static/tinkerbase.css_t

  * 
  * Stylesheet for base theme.
  *
- * :copyright: Copyright 2011 by Vlad Riscutia.
+ * :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+ * CONTRIBUTORS file)
  * :license: FreeBSD, see LICENSE file
  */
 

tinkerer/utils.py

 
     Tinkerer utility functions.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import datetime

tinkerer/writer.py

 
     Internal template writer - handles template rendering and blog setup.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 from jinja2 import Environment, PackageLoader

tinkertest/__main__.py

     -t, --theme builds a test blog with the given theme
     -c, --clean cleans up test directory
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import argparse

tinkertest/test_categories.py

 
     Tests Tinkerer post categoires.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import datetime

tinkertest/test_cmdline.py

 
     Tests Tinkerer command line (setup, post, page and build)
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import datetime

tinkertest/test_draft.py

 
     Tests creating drafts.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import datetime

tinkertest/test_master.py

 
     Tests updating the master document.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 from tinkerer import master

tinkertest/test_metadata.py

 
     Tests metadata collected by Tinkerer during build.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import datetime

tinkertest/test_ordering.py

 
     Tests that Tinkerer adds posts and pages in the correct order
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import datetime

tinkertest/test_page.py

 
     Tests creating pages.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import datetime

tinkertest/test_patch.py

 
     Tests link patching on aggreated pages and RSS feed.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import datetime

tinkertest/test_post.py

 
     Tests creating posts.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import datetime

tinkertest/test_rss.py

 
     Tests the RSS feed generator.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import datetime
 class TestRSS(utils.BaseTinkererTest):
     def test_rss(self):
         # create some posts
-        for new_post in [("Post 1", datetime.date(2010, 10, 1), "Lorem ipsum"),
-                         ("Post 2", datetime.date(2010, 11, 2), "dolor sit"),
-                         ("Post 3", datetime.date(2010, 12, 3), "amet, consectetuer")]:
-            post.create(new_post[0], new_post[1]).write(content=new_post[2])
+        for new_post in [
+                ("Post 1", 
+                    datetime.date(2010, 10, 1), 
+                    "Lorem ipsum", 
+                    "category 1"),
+                ("Post 2", 
+                    datetime.date(2010, 11, 2), 
+                    "dolor sit",
+                    "category 2"),
+                ("Post 3", 
+                    datetime.date(2010, 12, 3), 
+                    "amet, consectetuer",
+                    "category 3")]:
+            post.create(new_post[0], new_post[1]).write(
+                    content=new_post[2], 
+                    categories=new_post[3])
 
         self.build()
 
                 "guid": None, 
                 "title": None, 
                 "description": None, 
+                "category": None,
                 "pubDate": None
                }
 
                       "link" : "http://127.0.0.1/blog/html/2010/12/03/post_3.html",
                       "title": "Post 3",
                       "description": "amet, consectetuer",
+                      "category": "category 3",
                       "pubDate": "03 Dec 2010"},
 
                      {"index": 1,
                       "link" : "http://127.0.0.1/blog/html/2010/11/02/post_2.html",
                       "title": "Post 2",
                       "description": "dolor sit",
+                      "category": "category 2",
                       "pubDate": "02 Nov 2010"},
                         
                      {"index": 2,
                       "link" : "http://127.0.0.1/blog/html/2010/10/01/post_1.html",
                       "title": "Post 1",
                       "description": "Lorem ipsum",
+                      "category": "category 1",
                       "pubDate": "01 Oct 2010"}]:
 
             data = self.get_data(
             self.assertEquals(item["link"], data["guid"])
             self.assertEquals(item["title"], data["title"])
             self.assertIn(item["description"], data["description"])
+            self.assertIn(item["category"], data["category"])
             self.assertIn(item["pubDate"], data["pubDate"])
 
 
+
     # get a dictionary of the given data in an XML node
     def get_data(self, node, data):
         for child in data.keys():

tinkertest/test_tags.py

 
     Tests Tinkerer post tags.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import datetime

tinkertest/utils.py

 
     Base test case class inherited by all test cases. Utility functions.
 
-    :copyright: Copyright 2011 by Vlad Riscutia
+    :copyright: Copyright 2011-2012 by Vlad Riscutia and contributors (see
+    CONTRIBUTORS file)
     :license: FreeBSD, see LICENSE file
 '''
 import datetime
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.