Browse Source

Fix failing tests and formatting issues.

- Fix tests that were failing because of misconfigured
  template path
- Fix formatting issues identified by flake8
main
Lakshmi Narasimhan 9 years ago
parent
commit
1385f5e3f5
9 changed files with 37 additions and 27 deletions
  1. +3
    -0
      .gitignore
  2. +1
    -1
      README.rst
  3. +3
    -2
      hyde/ext/plugins/images.py
  4. +1
    -0
      hyde/template.py
  5. +2
    -2
      hyde/tests/sites/test_grouper/site.yaml
  6. +1
    -1
      hyde/tests/sites/test_jinja/site.yaml
  7. +2
    -1
      hyde/tests/test_model.py
  8. +1
    -1
      hyde/version.py
  9. +23
    -19
      setup.py

+ 3
- 0
.gitignore View File

@@ -88,3 +88,6 @@ src
.coverage

*.tar.gz

# hyde plugins
node_modules

+ 1
- 1
README.rst View File

@@ -1,4 +1,4 @@
Version 0.8.8
Version 0.8.9a

.. image:: https://travis-ci.org/hyde/hyde.svg?branch=master



+ 3
- 2
hyde/ext/plugins/images.py View File

@@ -381,8 +381,9 @@ class ImageThumbnailsPlugin(PILPlugin):
preserve_orientation = True
dim1, dim2 = larger, smaller

match_includes = lambda s: any(
[glob.fnmatch.fnmatch(s, inc) for inc in include])
def match_includes(s):
return any([glob.fnmatch.fnmatch(s, inc)
for inc in include])

for resource in node.resources:
if match_includes(resource.path):


+ 1
- 0
hyde/template.py View File

@@ -11,6 +11,7 @@ from commando.util import getLoggerWithNullHandler, load_python_object

DEFAULT_TEMPLATE = 'hyde.ext.templates.jinja.Jinja2Template'


class HtmlWrap(object):

"""


+ 2
- 2
hyde/tests/sites/test_grouper/site.yaml View File

@@ -1,6 +1,6 @@
mode: development
media_root:: media # Relative path from site root (the directory where this file exists)
media_url: /media
template: hyde.ext.jinja2
template: hyde.ext.templates.jinja.Jinja2Template
meta:
nodemeta: meta.yaml
nodemeta: meta.yaml

+ 1
- 1
hyde/tests/sites/test_jinja/site.yaml View File

@@ -1,4 +1,4 @@
mode: development
media_root:: media # Relative path from site root (the directory where this file exists)
media_url: /media
template: hyde.ext.jinja2
template: hyde.ext.templates.jinja.Jinja2Template

+ 2
- 1
hyde/tests/test_model.py View File

@@ -72,7 +72,8 @@ def test_expando_to_dict_with_update():

TEST_SITE = File(__file__).parent.child_folder('_test')

import yaml

import yaml # NOQA


class TestConfig(object):


+ 1
- 1
hyde/version.py View File

@@ -2,4 +2,4 @@
"""
Handles hyde version.
"""
__version__ = '0.8.8'
__version__ = '0.8.9a'

+ 23
- 19
setup.py View File

@@ -13,7 +13,7 @@ try:
except IOError:
long_description = ''

################################################################################
##############################################################################
# find_package_data is an Ian Bicking creation.

# Provided as an attribute, so you can append to these instead
@@ -22,12 +22,13 @@ standard_exclude = ('*.py', '*.pyc', '*~', '.*', '*.bak', '*.swp*')
standard_exclude_directories = ('.*', 'CVS', '_darcs', './build',
'./dist', 'EGG-INFO', '*.egg-info')


def find_package_data(
where='.', package='',
exclude=standard_exclude,
exclude_directories=standard_exclude_directories,
only_in_packages=True,
show_ignored=False):
where='.', package='',
exclude=standard_exclude,
exclude_directories=standard_exclude_directories,
only_in_packages=True,
show_ignored=False):
"""
Return a dictionary suitable for use in ``package_data``
in a distutils ``setup.py`` file.
@@ -66,8 +67,9 @@ def find_package_data(
if os.path.isdir(fn):
bad_name = False
for pattern in exclude_directories:
if (fnmatchcase(name, pattern)
or fn.lower() == pattern.lower()):
if fnmatchcase(name, pattern) or \
fn.lower() == pattern.lower():

bad_name = True
if show_ignored:
print >> sys.stderr, (
@@ -83,13 +85,15 @@ def find_package_data(
new_package = package + '.' + name
stack.append((fn, '', new_package, False))
else:
stack.append((fn, prefix + name + '/', package, only_in_packages))
stack.append((fn, prefix + name + '/', package,
only_in_packages))
elif package or not only_in_packages:
# is a file
bad_name = False
for pattern in exclude:
if (fnmatchcase(name, pattern)
or fn.lower() == pattern.lower()):
if fnmatchcase(name, pattern) \
or fn.lower() == pattern.lower():

bad_name = True
if show_ignored:
print >> sys.stderr, (
@@ -100,12 +104,13 @@ def find_package_data(
continue
out.setdefault(package, []).append(prefix+name)
return out
################################################################################

##############################################################################

setup(name=PROJECT,
version=__version__,
description='hyde is a static website generator',
long_description = long_description,
long_description=long_description,
author='Lakshmi Vyas',
author_email='lakshmi.vyas@gmail.com',
url='http://hyde.github.com',
@@ -132,14 +137,14 @@ setup(name=PROJECT,
'flake8==2.4.1'
),
test_suite='nose.collector',
include_package_data = True,
include_package_data=True,
# Scan the input for package information
# to grab any data files (text, images, etc.)
# associated with sub-packages.
package_data = find_package_data(PROJECT,

package_data=find_package_data(PROJECT,
package=PROJECT,
only_in_packages=False,
),
only_in_packages=False,),
entry_points={
'console_scripts': [
'hyde = hyde.main:main'
@@ -164,5 +169,4 @@ setup(name=PROJECT,
'Topic :: Internet',
'Topic :: Internet :: WWW/HTTP :: Site Management',
],
zip_safe=False,
)
zip_safe=False,)

Loading…
Cancel
Save