Skip to content

Commit

Permalink
PEP-8 clean-up. Get rid of pony.png on personalize
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikko committed May 28, 2012
1 parent 7299440 commit 8874585
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
15 changes: 8 additions & 7 deletions personalize.py
Expand Up @@ -24,12 +24,13 @@
IGNORE_MASKS = ["*.pyc", "*.pyo", "*.git*", "*.egg*", "*.EGG*"]

FILES_TO_DELETE = [
".git",
"README.rst",
"youraddon.egg-info",
".git",
"README.rst",
"youraddon.egg-info",
"youraddon/templates/helloworld.pt",
"youraddon/templates/myfooter.pt",
"youraddon/templates/plone.app.layout.viewlets.logo.pt",
"youraddon/static/pony.png"
]

def process(fname, newname):
Expand Down Expand Up @@ -60,7 +61,7 @@ def process(fname, newname):
for line in data.split("\n"):
if "EXAMPLES START" in line:
filtering = True

if not filtering:
new_lines.append(line)

Expand All @@ -70,7 +71,7 @@ def process(fname, newname):
# Write the output
data = "\n".join(new_lines)

f = open(fname, "wt")
f = open(fname, "wt")
f.write(data)
f.close()

Expand Down Expand Up @@ -98,7 +99,7 @@ def post_cleanup(target, newname):
shutil.rmtree(fname)
else:
os.remove(fname)

def fancy_replace(newname):
""" """

Expand All @@ -120,7 +121,7 @@ def fancy_replace(newname):
for name in files:
fname = os.path.join(root, name)
process(fname, newname)

for name in dirs:
fname = os.path.join(root, name)
process(fname, newname)
Expand Down
7 changes: 4 additions & 3 deletions youraddon/interfaces.py
Expand Up @@ -8,9 +8,10 @@
"""

from zope.interface import Interface
from zope.interface import Interface
from plone.theme.interfaces import IDefaultPloneLayer


class IThemeSpecific(IDefaultPloneLayer):
"""
Marker interface that defines a browser layer against which you can register views and viewlets.
Expand All @@ -19,11 +20,11 @@ class IThemeSpecific(IDefaultPloneLayer):
override default Plone render actions.
"""

class IAddonSpecific(Interface):

class IAddonSpecific(Interface):
"""
Marker interface that defines a browser layer against which you can register views and viewlets.
When your add-on is installed this layer becomes active and all overrides associated with
override default Plone render actions.
"""

8 changes: 5 additions & 3 deletions youraddon/viewlets.py
Expand Up @@ -2,7 +2,7 @@
For more information see
* http://collective-docs.readthedocs.org/en/latest/views/viewlets.html
* http://collective-docs.readthedocs.org/en/latest/views/viewlets.html
"""

Expand All @@ -23,10 +23,12 @@
# By default, set context to zope.interface.Interface
# which matches all the content items.
# You can register viewlets to be content item type specific
# by overriding grok.context() on class body level
# by overriding grok.context() on class body level
grok.context(Interface)

# EXAMPLES START


class MyFooter(grok.Viewlet):
"""
An example viewlet.
Expand All @@ -43,7 +45,7 @@ def update(self):
These variables are exposed via ``viewlet/`` traversing in page template code.
"""

# See
# See
# http://collective-docs.readthedocs.org/en/latest/misc/context.html
# how to acquire various helper utilities related to self.context
self.portal_state = getMultiAdapter((self.context, self.request), name="plone_portal_state")
Expand Down

0 comments on commit 8874585

Please sign in to comment.