@@ -8,4 +8,7 @@ deploy/* | |||||
pylint* | pylint* | ||||
*.tmproj | *.tmproj | ||||
test_site | test_site | ||||
dist | |||||
build | |||||
*egg* | |||||
@@ -5,7 +5,7 @@ Implements the hyde entry point commands | |||||
from commando import * | from commando import * | ||||
from hyde.exceptions import HydeException | from hyde.exceptions import HydeException | ||||
from hyde.fs import File, Folder | from hyde.fs import File, Folder | ||||
from hyde.layout import Layout | |||||
from hyde.layout import Layout, HYDE_DATA | |||||
from hyde.version import __version__ | from hyde.version import __version__ | ||||
import os | import os | ||||
@@ -42,9 +42,9 @@ class Engine(Application): | |||||
if sitepath.exists and not args.overwrite: | if sitepath.exists and not args.overwrite: | ||||
raise HydeException("The given site path[%s] is not empty" % sitepath) | raise HydeException("The given site path[%s] is not empty" % sitepath) | ||||
layout = Layout.find_layout(args.layout) | layout = Layout.find_layout(args.layout) | ||||
if not layout.exists: | |||||
if not layout or not layout.exists: | |||||
raise HydeException( | raise HydeException( | ||||
"The given layout is invalid. Please check if you have the `layout` " | "The given layout is invalid. Please check if you have the `layout` " | ||||
"is in the right place and the environment variable has been setup" | |||||
"properly") | |||||
"in the right place and the environment variable(%s) has been setup " | |||||
"properly if you are using custom path for layouts" % HYDE_DATA) | |||||
layout.copy_to(args.sitepath) | layout.copy_to(args.sitepath) |
@@ -43,3 +43,9 @@ def test_ensure_no_exception_when_sitepath_does_not_exist(): | |||||
assert TEST_SITE.child_folder('layout').exists | assert TEST_SITE.child_folder('layout').exists | ||||
assert File(TEST_SITE.child('info.yaml')).exists | assert File(TEST_SITE.child('info.yaml')).exists | ||||
@raises(HydeException) | |||||
@with_setup(create_test_site, delete_test_site) | |||||
def test_ensure_exception_when_layout_is_invalid(): | |||||
e = Engine() | |||||
e.run(e.parse(['-s', str(TEST_SITE), 'init', '-l', 'junk'])) | |||||
@@ -55,8 +55,8 @@ def test_render(): | |||||
""" | """ | ||||
Uses pyquery to test the html structure for validity | Uses pyquery to test the html structure for validity | ||||
""" | """ | ||||
t = Jinja2Template() | |||||
t.configure(JINJA2.path, None) | |||||
t = Jinja2Template(JINJA2.path) | |||||
t.configure(None) | |||||
t.env.filters['dateformat'] = dateformat | t.env.filters['dateformat'] = dateformat | ||||
html = t.render('index.html', context) | html = t.render('index.html', context) | ||||
from pyquery import PyQuery | from pyquery import PyQuery | ||||
@@ -5,5 +5,9 @@ The hyde executable | |||||
""" | """ | ||||
from hyde.engine import Engine | from hyde.engine import Engine | ||||
def main(): | |||||
"""Main""" | |||||
Engine().run() | |||||
if __name__ == "__main__": | if __name__ == "__main__": | ||||
Engine().run() | |||||
main() |
@@ -0,0 +1,41 @@ | |||||
from setuptools import setup, find_packages | |||||
from hyde.version import __version__ | |||||
setup(name='hyde', | |||||
version=__version__, | |||||
description='hyde is a pythonic static website generator', | |||||
author='Lakshmi Vyas', | |||||
author_email='lakshmi.vyas@gmail.com', | |||||
url='http://ringce.com/hyde', | |||||
packages=find_packages(), | |||||
install_requires=( | |||||
'commando', | |||||
'jinja2', | |||||
'pyYAML', | |||||
'markdown' | |||||
), | |||||
scripts=['main.py'], | |||||
entry_points={ | |||||
'console_scripts': [ | |||||
'hyde = main:main' | |||||
] | |||||
}, | |||||
license='MIT', | |||||
classifiers=[ | |||||
'Development Status :: 3 - Alpha', | |||||
'Environment :: Console', | |||||
'Intended Audience :: End Users/Desktop', | |||||
'Intended Audience :: Developers', | |||||
'Intended Audience :: System Administrators', | |||||
'License :: OSI Approved :: MIT License', | |||||
'Operating System :: MacOS :: MacOS X', | |||||
'Operating System :: Unix', | |||||
'Operating System :: POSIX', | |||||
'Programming Language :: Python', | |||||
'Programming Language :: Python :: 2.7', | |||||
'Topic :: Software Development', | |||||
'Topic :: Software Development :: Build Tools', | |||||
'Topic :: Software Development :: Websites', | |||||
'Topic :: Software Development :: Static Websites', | |||||
], | |||||
) |