Skip to content
This repository has been archived by the owner on Apr 23, 2018. It is now read-only.

Commit

Permalink
Fix typos and update version
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed Nov 13, 2013
1 parent 062cce4 commit e19acbd
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions pynuts/__init__.py
@@ -1,6 +1,6 @@
"""__init__ file for Pynuts."""
"""Pynuts: Documents for nuts."""

__version__ = '0.4.3.1'
__version__ = '0.5'

import os
import sys
Expand Down Expand Up @@ -66,14 +66,16 @@ class Context(object, metaclass=MetaContext):
"""Context base class of the application.
You can get or set any element in the context stored in
the `g` flask object.
the ``g`` flask object.
Example : Set the current time of the request in the context, using
datetime :
Example: Set the current time of the request in the context, using
datetime:
@app.before_request
def set_request_time():
g.context.request_time = datetime.now().strftime('%Y/%m/%d')
.. sourcecode:: python
@app.before_request
def set_request_time():
g.context.request_time = datetime.now().strftime('%m/%d')
"""
_pynuts = self
Expand Down Expand Up @@ -108,19 +110,19 @@ class ModelView(view.ModelView):

@cached_property
def document_repository(self):
""" Return the application bare git document repository.
If the application has a `PYNUTS_DOCUMENT_REPOSITORY`
configuration key expressed as an absolute path, the repo
will be located at this path. If this configuration key
is expressed as a relative path, its location will be taken
relatively to the application instance path.
Finally, if no such configuration is found, a bare git
repository will be created in the `documents.git` directory,
located at the application instance path.
All parent directories will be created if needed, and if
non-existent, the repository will be initialized.
"""Return the application bare git document repository.
If the application has a ``PYNUTS_DOCUMENT_REPOSITORY`` configuration
key expressed as an absolute path, the repo will be located at this
path. If this configuration key is expressed as a relative path, its
location will be taken relatively to the application instance path.
Finally, if no such configuration is found, a bare git repository will
be created in the ``documents.git`` directory, located at the
application instance path.
All parent directories will be created if needed, and if
non-existent, the repository will be initialized.
"""
self.document_repository_path = (
os.path.join(
Expand Down Expand Up @@ -154,6 +156,7 @@ def static(filename):
""" Return files from Pynuts static folder.
:param filename: the basename of the file contained in Pynuts static folder
"""
return flask.send_from_directory(
os.path.join(os.path.dirname(__file__), 'static'), filename)
Expand Down

0 comments on commit e19acbd

Please sign in to comment.