From 7b0104a604867f155bce9b51fe8fca83116cacbf Mon Sep 17 00:00:00 2001 From: Pedro Rodrigues Date: Sun, 31 Jul 2016 18:55:33 +0100 Subject: fixes some code style conformance errors --- pycco/compat.py | 1 + pycco/main.py | 43 ++++++++++++++++++++++--------------------- pycco_resources/__init__.py | 4 ++-- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/pycco/compat.py b/pycco/compat.py index 68233a4..856ed6c 100644 --- a/pycco/compat.py +++ b/pycco/compat.py @@ -3,6 +3,7 @@ try: except NameError: pycco_unichr = chr + def compat_items(d): try: return d.iteritems() diff --git a/pycco/main.py b/pycco/main.py index fe1a8be..55ab0ff 100644 --- a/pycco/main.py +++ b/pycco/main.py @@ -4,6 +4,19 @@ from __future__ import print_function # This module contains all of our static resources. from pycco_resources import pycco_template, css as pycco_css +# Import our external dependencies. +import optparse +import os +import pygments +import re +import sys +import time +import pycco.generate_index as generate_index + +from markdown import markdown +from os import path +from pygments import lexers, formatters + """ "**Pycco**" is a Python port of [Docco](http://jashkenas.github.com/docco/): the original quick-and-dirty, hundred-line-long, literate-programming-style @@ -293,20 +306,8 @@ def generate_html(source, sections, preserve_paths=True, outdir=None): return re.sub(r"__DOUBLE_OPEN_STACHE__", "{{", rendered).encode("utf-8") -# === Helpers & Setup === - -# Import our external dependencies. -import optparse -import os -import pygments -import re -import sys -import time -import pycco.generate_index as generate_index -from markdown import markdown -from os import path -from pygments import lexers, formatters +# === Helpers & Setup === # A list of the languages that Pycco supports, mapping the file extension to # the name of the Pygments lexer and the symbol that indicates a comment. To @@ -315,22 +316,22 @@ languages = { ".coffee": {"name": "coffee-script", "symbol": "#", "multistart": '###', "multiend": '###'}, - ".pl": {"name": "perl", "symbol": "#"}, + ".pl": {"name": "perl", "symbol": "#"}, ".sql": {"name": "sql", "symbol": "--"}, ".sh": {"name": "bash", "symbol": "#"}, - ".c": {"name": "c", "symbol": "//", - "multistart": "/*", "multiend": "*/"}, + ".c": {"name": "c", "symbol": "//", + "multistart": "/*", "multiend": "*/"}, - ".h": {"name": "c", "symbol": "//", - "multistart": "/*", "multiend": "*/"}, + ".h": {"name": "c", "symbol": "//", + "multistart": "/*", "multiend": "*/"}, ".cpp": {"name": "cpp", "symbol": "//"}, - ".cl": {"name": "c", "symbol": "//", - "multistart": "/*", "multiend": "*/"}, + ".cl": {"name": "c", "symbol": "//", + "multistart": "/*", "multiend": "*/"}, ".js": {"name": "javascript", "symbol": "//", "multistart": "/*", "multiend": "*/"}, @@ -349,7 +350,7 @@ languages = { ".erl": {"name": "erlang", "symbol": "%%"}, - ".tcl": {"name": "tcl", "symbol": "#"}, + ".tcl": {"name": "tcl", "symbol": "#"}, ".hs": {"name": "haskell", "symbol": "--", "multistart": "{-", "multiend": "-}"}, diff --git a/pycco_resources/__init__.py b/pycco_resources/__init__.py index a0eb757..08767b7 100644 --- a/pycco_resources/__init__.py +++ b/pycco_resources/__init__.py @@ -1,3 +1,5 @@ +import pystache + css = """\ /*--------------------- Layout and Typography ----------------------------*/ body { @@ -236,8 +238,6 @@ html = """\ """ -import pystache - def template(source): return lambda context: pystache.render(source, context) -- cgit v1.2.1