Permalink
Browse files

flake8ed

  • Loading branch information...
joshourisman committed Oct 15, 2011
1 parent bcf0dc2 commit 30387b1982b7075817175c0740e767ea8f9ccbba
Showing with 6 additions and 6 deletions.
  1. +2 −1 rabbitfish/cli.py
  2. +0 −2 rabbitfish/jug.py
  3. +4 −3 rabbitfish/pages.py
View
@@ -7,6 +7,7 @@
VERSION = "0.1a"
+
def main():
print("One dead, unjugged rabbitfish later...", file=sys.stderr)
usage = "usage: %prog ACTION"
@@ -36,6 +37,6 @@ def main():
return
ACTIONS[action]()
-
+
if __name__ == "__main__":
main()
View
@@ -2,7 +2,6 @@
import shutil
import yaml
-from pages import Page, DynamicPage
def generatesite():
config = yaml.load(open("config.yaml", 'r'))
@@ -11,4 +10,3 @@ def generatesite():
shutil.rmtree('output')
for page in pages:
page.render_to_output()
-
View
@@ -6,6 +6,7 @@
env = Environment(loader=FileSystemLoader('templates'))
+
class Page(yaml.YAMLObject):
yaml_tag = '!Page'
@@ -27,6 +28,7 @@ def render_to_output(self):
os.makedirs(self.directory)
open(self.output, 'w').write(self.render_to_string())
+
class DynamicPage(Page):
yaml_tag = '!DynamicPage'
@@ -40,9 +42,9 @@ def render_to_string(self):
self.name, self.template))
template = env.get_template(self.template)
content_list = yaml.load_all(open("content/{}.yaml".format(self.name)))
- return {content['slug']:template.render(**content) for
+ return {content['slug']: template.render(**content) for
content in content_list}
-
+
def render_to_output(self):
print("Rendering dynamic page {0} with {1}".format(
self.name, self.template))
@@ -62,4 +64,3 @@ def render_to_output(self):
if not os.path.exists(directory):
os.makedirs(directory)
open(output, 'w').write(html)
-

0 comments on commit 30387b1

Please sign in to comment.