Skip to content

Commit

Permalink
Merge pull request #6 from fschulze/master
Browse files Browse the repository at this point in the history
Preparations for 1.2 release.
  • Loading branch information
malthe committed Sep 23, 2014
2 parents 29a2035 + bb555ad commit 70394f9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CHANGES.txt
@@ -1,7 +1,7 @@
Changelog
=========

1.2 (Unreleased)
1.2 (2014-09-23)
----------------

- We are compatible with Pyramid 1.3 and up.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -51,7 +51,7 @@
testing_extras.append("pyinotify")

setup(name='pyramid_skins',
version = '1.2dev',
version = '1.2',
description='Templating framework for Pyramid.',
long_description=long_description,
keywords = "pyramid templates",
Expand Down
30 changes: 17 additions & 13 deletions src/pyramid_skins/docs/registration.rst
Expand Up @@ -320,22 +320,26 @@ Let's add a new skin template with the source:
import os
import imp
import shutil
import sys
import tempfile
f = tempfile.NamedTemporaryFile(suffix=".py")
try:
path, suffix = os.path.splitext(f.name)
module = os.path.basename(path)
imp.load_module(module, open(f.name), path, (suffix, "r", imp.PY_SOURCE))
finally:
f.close()
# make skins directory
dir = os.path.join(os.path.dirname(path), "skins")
if not os.path.exists(dir):
os.mkdir(dir)
g = None
tmppath = tempfile.mkdtemp()
try:
try:
f = open(os.path.join(tmppath, 'foo.py'), 'w')
path, suffix = os.path.splitext(f.name)
module = os.path.basename(path)
imp.load_module(module, open(f.name), path, (suffix, "r", imp.PY_SOURCE))
finally:
f.close()
# make skins directory
dir = os.path.join(os.path.dirname(path), "skins")
if not os.path.exists(dir):
os.mkdir(dir)
g = None
# register skin directory
_ = xmlconfig("""
<configure xmlns="http://pylonshq.com/pyramid"
Expand Down Expand Up @@ -372,7 +376,7 @@ Let's add a new skin template with the source:
g.close()
finally:
os.removedirs(dir)
shutil.rmtree(tmppath)
>>> print output
200 OK
Expand Down

0 comments on commit 70394f9

Please sign in to comment.