Browse Source

Fixed init statement. Added setup.py

main
Lakshmi Vyasarajan 14 years ago
parent
commit
0bef877549
6 changed files with 61 additions and 7 deletions
  1. +3
    -0
      .gitignore
  2. +4
    -4
      hyde/engine.py
  3. +6
    -0
      hyde/tests/test_initialize.py
  4. +2
    -2
      hyde/tests/test_jinja2template.py
  5. +5
    -1
      main.py
  6. +41
    -0
      setup.py

+ 3
- 0
.gitignore View File

@@ -8,4 +8,7 @@ deploy/*
pylint*
*.tmproj
test_site
dist
build
*egg*


+ 4
- 4
hyde/engine.py View File

@@ -5,7 +5,7 @@ Implements the hyde entry point commands
from commando import *
from hyde.exceptions import HydeException
from hyde.fs import File, Folder
from hyde.layout import Layout
from hyde.layout import Layout, HYDE_DATA
from hyde.version import __version__

import os
@@ -42,9 +42,9 @@ class Engine(Application):
if sitepath.exists and not args.overwrite:
raise HydeException("The given site path[%s] is not empty" % sitepath)
layout = Layout.find_layout(args.layout)
if not layout.exists:
if not layout or not layout.exists:
raise HydeException(
"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)

+ 6
- 0
hyde/tests/test_initialize.py View File

@@ -43,3 +43,9 @@ def test_ensure_no_exception_when_sitepath_does_not_exist():
assert TEST_SITE.child_folder('layout').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']))


+ 2
- 2
hyde/tests/test_jinja2template.py View File

@@ -55,8 +55,8 @@ def test_render():
"""
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
html = t.render('index.html', context)
from pyquery import PyQuery


hyde/main.py → main.py View File

@@ -5,5 +5,9 @@ The hyde executable
"""
from hyde.engine import Engine

def main():
"""Main"""
Engine().run()

if __name__ == "__main__":
Engine().run()
main()

+ 41
- 0
setup.py View File

@@ -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',
],
)

Loading…
Cancel
Save