Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pep8 cleanup (fixed) #14

Merged
merged 229 commits into from May 20, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
229 commits
Select commit Hold shift + click to select a range
77d7939
pep8 cleanup
May 19, 2012
d3cde68
changed comment spacing for consistency
May 19, 2012
6d00959
pep8 cleanup
May 19, 2012
2d15078
pep8/consistency cleanup
May 19, 2012
a32b186
pep8/consistency cleanup
May 19, 2012
0442ffb
pep8/consistency cleanup
May 19, 2012
f1247c6
pep8/consistency cleanup
May 19, 2012
eb68d58
pep8/consistency cleanup
May 19, 2012
9a63837
pep8/consistency cleanup
May 19, 2012
a32fb0e
pep8/consistency cleanup
May 19, 2012
13df384
pep8/consistency cleanup
May 19, 2012
6d1c87d
pep8/consistency cleanup
May 19, 2012
7fc3185
pep8/consistency cleanup
May 19, 2012
b238c44
pep8/consistency cleanup
May 19, 2012
b156f25
pep8/consistency cleanup
May 19, 2012
4fba5b6
pep8/consistency cleanup
May 19, 2012
a73b3e2
pep8/consistency cleanup
May 19, 2012
5d51941
pep8/consistency cleanup
May 19, 2012
64c10e4
pep8/consistency cleanup
May 19, 2012
007b926
pep8/consistency cleanup
May 19, 2012
a59820e
pep8/consistency cleanup
May 19, 2012
3d06d6d
pep8/consistency cleanup
May 19, 2012
2a1c816
pep8/consistency cleanup
May 19, 2012
05d57cc
pep8/consistency cleanup
May 19, 2012
3d93fba
pep8/consistency cleanup
May 19, 2012
0fe5d80
pep8/consistency cleanup
May 19, 2012
1f99992
pep8/consistency cleanup
May 19, 2012
b142c5e
pep8/consistency cleanup
May 19, 2012
0b19ea3
pep8/consistency cleanup
May 19, 2012
4c8e14c
pep8/consistency cleanup
May 19, 2012
a2b5497
pep8/consistency cleanup
May 19, 2012
ce8c0b5
pep8/consistency cleanup
May 19, 2012
2e55938
pep8/consistency cleanup
May 19, 2012
505d2a1
pep8/consistency cleanup
May 19, 2012
5262eff
pep8/consistency cleanup
May 19, 2012
92f9a73
pep8/consistency cleanup
May 19, 2012
537c0d9
pep8/consistency cleanup
May 19, 2012
7146e90
pep8/consistency cleanup
May 19, 2012
79337e6
pep8/consistency cleanup
May 19, 2012
9b3ddea
pep8/consistency cleanup
May 19, 2012
fd3cddf
pep8/consistency cleanup
May 19, 2012
bfcac7c
pep8/consistency cleanup
May 19, 2012
d14b8b0
pep8/consistency cleanup
May 19, 2012
3f89579
pep8/consistency cleanup
May 19, 2012
4d8328f
pep8/consistency cleanup
May 19, 2012
509ff94
pep8/consistency cleanup
May 19, 2012
408165e
pep8/consistency cleanup
May 19, 2012
d7e937c
pep8/consistency cleanup
May 19, 2012
8d7d435
pep8/consistency cleanup
May 19, 2012
24c586e
pep8/consistency cleanup
May 19, 2012
b5a8978
pep8/consistency cleanup
May 19, 2012
e40deec
pep8/consistency cleanup
May 19, 2012
86d23bc
pep8/consistency cleanup
May 19, 2012
5a82c97
pep8/consistency cleanup
May 19, 2012
452d34c
pep8/consistency cleanup
May 19, 2012
5e3dc79
pep8/consistency cleanup
May 19, 2012
da8874b
pep8/consistency cleanup
May 19, 2012
15c3739
pep8/consistency cleanup
May 19, 2012
00289f8
pep8/consistency cleanup
May 19, 2012
97e108a
pep8/consistency cleanup
May 19, 2012
104ca76
pep8/consistency cleanup
May 19, 2012
409874f
pep8/consistency cleanup
May 19, 2012
af63e0f
pep8/consistency cleanup
May 19, 2012
3024838
pep8 cleanup
May 19, 2012
e430321
pep8 cleanup
May 19, 2012
94e35e2
pep8 cleanup
May 19, 2012
c613651
pep8 cleanup
May 19, 2012
4683545
pep8 cleanup
May 19, 2012
966bbfe
pep8 cleanup, changed use of deprecated backticks to the repr function
May 19, 2012
804a47b
pep8 cleanup
May 19, 2012
ba325a2
pep8 cleanup
May 19, 2012
4fe7f7a
pep8 cleanup
May 19, 2012
64d47bd
pep8 cleanup
May 19, 2012
d2d3a31
pep8 cleanup
May 19, 2012
5499f57
pep8 cleanup
May 19, 2012
472806b
pep8 cleanup
May 19, 2012
6a15971
pep8 cleanup
May 19, 2012
820d39b
pep8 cleanup
May 19, 2012
27e2445
pep8 cleanup, added return for funciton getObjectPosition -- appeared…
May 19, 2012
43d898a
pep8 cleanup
May 19, 2012
b83e37c
pep8 cleanup
May 19, 2012
f2bed50
pep8 cleanup
May 19, 2012
ccf2555
pep8 cleanup
May 19, 2012
564ae1c
pep8 cleanup
May 19, 2012
952875a
pep8 cleanup
May 19, 2012
02b9eed
pep8 cleanup
May 19, 2012
b350c24
pep8 cleanup
May 19, 2012
4fdf380
pep8 cleanup
May 19, 2012
316116e
pep8 cleanup
May 19, 2012
26d4ddb
pep8 cleanup
May 19, 2012
0a17ab1
pep8 cleanup
May 19, 2012
37817b5
pep8 cleanup
May 19, 2012
e74b368
pep8 cleanup
May 19, 2012
0cabb67
pep8 cleanup
May 19, 2012
b24921f
pep8 cleanup
May 19, 2012
3aa38a9
pep8 cleanup
May 19, 2012
a101ca8
pep8 cleanup
May 19, 2012
c9a8d7d
pep8 cleanup
May 19, 2012
1741a37
pep8 cleanup
May 19, 2012
1d643e9
pep8 cleanup
May 19, 2012
4a32722
pep8 cleanup
May 19, 2012
cfd29ec
pep8 cleanup
May 19, 2012
4c432f2
pep8 cleanup
May 19, 2012
91b70d2
pep8 cleanup
May 19, 2012
9ae0153
pep8 cleanup
May 19, 2012
841b188
pep8 cleanup
May 19, 2012
46be1e8
pep8 cleanup
May 19, 2012
caedf1a
pep8/consistency cleanup
May 19, 2012
56347d3
pep8/consistency cleanup
May 19, 2012
5f7ada9
pep8/consistency cleanup
May 19, 2012
65aca07
pep8/consistency cleanup
May 19, 2012
e1817e7
pep8/consistency cleanup
May 19, 2012
f0a9c1e
pep8/consistency cleanup
May 19, 2012
925bda7
pep8/consistency cleanup
May 19, 2012
a55e916
pep8/consistency cleanup
May 19, 2012
0745f23
pep8/consistency cleanup
May 19, 2012
715f610
pep8/consistency cleanup
May 19, 2012
6aa0442
pep8/consistency cleanup
May 19, 2012
21ed07e
pep8/consistency cleanup
May 19, 2012
34bd256
pep8/consistency cleanup
May 19, 2012
b5a1104
pep8/consistency cleanup
May 19, 2012
ee39240
pep8/consistency cleanup
May 19, 2012
f28160a
pep8/consistency cleanup
May 19, 2012
bc3d901
pep8/consistency cleanup
May 19, 2012
57e3a64
pep8/consistency cleanup
May 19, 2012
0617722
pep8/consistency cleanup
May 19, 2012
4e0ac0a
pep8/consistency cleanup
May 19, 2012
fbf55c7
pep8/consistency cleanup
May 19, 2012
7dea6f2
pep8/consistency cleanup
May 19, 2012
290875b
pep8/consistency cleanup
May 19, 2012
e362d66
pep8/consistency cleanup
May 19, 2012
2ada06f
pep8/consistency cleanup
May 19, 2012
dec2415
pep8/consistency cleanup
May 19, 2012
39371f5
pep8/consistency cleanup
May 19, 2012
8b6d36e
pep8/consistency cleanup
May 19, 2012
42d040e
pep8/consistency cleanup
May 19, 2012
7b743c0
pep8/consistency cleanup
May 19, 2012
062160a
pep8/consistency cleanup
May 19, 2012
91a83cc
pep8/consistency cleanup
May 19, 2012
caeb581
pep8/consistency cleanup
May 19, 2012
dfcaad3
pep8/consistency cleanup
May 19, 2012
4782f32
pep8/consistency cleanup
May 19, 2012
2548c84
pep8/consistency cleanup
May 19, 2012
943e4d9
pep8/consistency cleanup
May 19, 2012
f9381e2
pep8/consistency cleanup
May 19, 2012
10afb05
pep8/consistency cleanup
May 19, 2012
13f7a5c
pep8/consistency cleanup
May 19, 2012
e7ddc44
pep8/consistency cleanup
May 19, 2012
1d07b3f
pep8/consistency cleanup
May 19, 2012
b94ec5a
pep8/consistency cleanup
May 19, 2012
7c490fb
pep8/consistency cleanup
May 19, 2012
c0fa166
pep8/consistency cleanup
May 19, 2012
c939049
pep8/consistency cleanup
May 19, 2012
a61c69e
pep8/consistency cleanup
May 19, 2012
f31f71d
pep8/consistency cleanup
May 19, 2012
6b3643a
pep8/consistency cleanup
May 19, 2012
e7c5198
pep8/consistency cleanup
May 19, 2012
9022132
pep8/consistency cleanup
May 19, 2012
fe44ae7
pep8/consistency cleanup
May 19, 2012
d9f6e5e
pep8/consistency cleanup
May 19, 2012
ed80caa
pep8/consistency cleanup
May 19, 2012
02336db
pep8/consistency cleanup
May 19, 2012
88e776d
pep8/consistency cleanup
May 19, 2012
069d1cc
pep8/consistency cleanup
May 19, 2012
9c7150b
pep8/consistency cleanup
May 19, 2012
318a19d
pep8/consistency cleanup
May 19, 2012
71def81
pep8/consistency cleanup
May 19, 2012
8071dd3
pep8/consistency cleanup
May 19, 2012
ca4ee2e
pep8/consistency cleanup
May 19, 2012
2f25fe6
pep8/consistency cleanup
May 19, 2012
d462bdf
pep8/consistency cleanup
May 19, 2012
00cf80d
pep8/consistency cleanup
May 19, 2012
6171f7e
pep8 cleanup
May 19, 2012
20dc561
pep8 cleanup
May 19, 2012
03151fe
pep8 cleanup
May 19, 2012
d7fc311
pep8 cleanup
May 20, 2012
14f1f2b
pep8 cleanup
May 20, 2012
f5da660
pep8 cleanup
May 20, 2012
78d93e4
pep8 cleanup
May 20, 2012
130a138
pep8 cleanup
May 20, 2012
0e19681
pep8 cleanup
May 20, 2012
1a0a1b4
pep8 cleanup
May 20, 2012
9a15ba5
pep8 cleanup
May 20, 2012
c201310
pep8 cleanup
May 20, 2012
df6197c
pep8 cleanup
May 20, 2012
1f24387
pep8 cleanup
May 20, 2012
7ead251
pep8 cleanup
May 20, 2012
2b13130
pep8 cleanup
May 20, 2012
aacbf34
pep8 cleanup
May 20, 2012
e1511eb
pep8 cleanup
May 20, 2012
3f671b1
pep8 cleanup
May 20, 2012
bd52585
pep8 cleanup
May 20, 2012
217b0fb
pep8 cleanup
May 20, 2012
42cef56
pep8 cleanup
May 20, 2012
032e7cb
pep8 cleanup
May 20, 2012
9c04238
pep8 cleanup
May 20, 2012
8d63dc9
pep8 cleanup
May 20, 2012
2a0c4c2
pep8 cleanup
May 20, 2012
34daa3b
pep8 cleanup
May 20, 2012
ac5d316
pep8 cleanup
May 20, 2012
2adc110
pep8 cleanup
May 20, 2012
3bcda19
pep8 cleanup
May 20, 2012
fcf8920
pep8 cleanup
May 20, 2012
4539b75
pep8 cleanup
May 20, 2012
acc4909
pep8 cleanup
May 20, 2012
e18255f
pep8 cleanup
May 20, 2012
bfa54b0
pep8 cleanup
May 20, 2012
8af855f
pep8 cleanup
May 20, 2012
dd0c673
pep8 cleanup
May 20, 2012
9ff0841
pep8 cleanup
May 20, 2012
29945dc
pep8 cleanup
May 20, 2012
9cf4de3
pep8 cleanup
May 20, 2012
593022e
pep8 cleanup
May 20, 2012
29cde76
pep8 cleanup
May 20, 2012
7826349
pep8 cleanup
May 20, 2012
551ec4f
pep8 cleanup
May 20, 2012
682e57e
pep8 cleanup
May 20, 2012
dd2fb78
pep8 cleanup
May 20, 2012
3aa2557
pep8 cleanup
May 20, 2012
6ce995e
pep8 cleanup
May 20, 2012
8047b96
pep8 cleanup
May 20, 2012
c0510b9
pep8 cleanup
May 20, 2012
cf943ee
pep8 cleanup
May 20, 2012
9aee9d9
pep8 cleanup
May 20, 2012
6c53ece
pep8 cleanup
May 20, 2012
ed11dcf
pep8 cleanup
May 20, 2012
29ff07a
The imports here are used elsewhere in the product, so I re-added the…
May 20, 2012
02c211e
Re-added some imports that I found to be used when running tests
May 20, 2012
064fcd4
Readded some import statements I found to be used when running tests
May 20, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
54 changes: 21 additions & 33 deletions Products/CMFPlone/ActionIconsTool.py
Expand Up @@ -27,27 +27,27 @@ class ActionIconsTool(PloneBaseTool, BaseTool):
toolicon = 'skins/plone_images/confirm_icon.png'

security.declareProtected(View, 'renderActionIcon')
def renderActionIcon( self,
category,
action_id,
default=None,
context=None ):
def renderActionIcon(self,
category,
action_id,
default=None,
context=None):
""" Returns the actual object for the icon. If you
pass in a path elements in default it will attempt
to traverse to that path. Otherwise it will return
None
"""
icon = self.queryActionIcon( category,
action_id,
default=default,
context=context )
icon = self.queryActionIcon(category,
action_id,
default=default,
context=context)
if icon is not None:
portal=getToolByName(self, 'portal_url').getPortalObject()
portal = getToolByName(self, 'portal_url').getPortalObject()
return portal.restrictedTraverse(icon)

return default

def getActionIcon( self, category, action_id, context=None ):
def getActionIcon(self, category, action_id, context=None):
ai = BaseTool.getActionIcon(self, category, action_id,
context=context)
if ai:
Expand All @@ -60,8 +60,7 @@ def getActionIcon( self, category, action_id, context=None ):
return ai
return None

def queryActionIcon( self, category, action_id
, default=None, context=None ):
def queryActionIcon(self, category, action_id, default=None, context=None):
ai = BaseTool.queryActionIcon(self, category, action_id,
default=default, context=context)
if ai:
Expand Down Expand Up @@ -89,13 +88,8 @@ def addActionIcon(self, category, action_id, icon_expr, title=None,

#Below we need to invalidate the cache for icons. We have to
#hardocde the module dict because we do not have events, yet.
def updateActionIcon( self
, category
, action_id
, icon_expr
, title=None
, priority=0
):
def updateActionIcon(self, category, action_id, icon_expr,
title=None, priority=0):
""" update ActionIcons and remove cache entry """
log_deprecated("The icon for the '%s/%s' action is being updated on "
"the action icons tool. The action icons tool has "
Expand All @@ -107,30 +101,24 @@ def updateActionIcon( self
title, priority)
removeAICacheEntry(category, action_id)

def removeActionIcon( self, category, action_id ):
def removeActionIcon(self, category, action_id):
""" remove ActionIcon and remove cache entry """
BaseTool.removeActionIcon(self, category, action_id)
removeAICacheEntry(category, action_id)

def clearActionIcons( self ):
def clearActionIcons(self):
""" clear ActionIcons and cache entries """
BaseTool.clearActionIcons(self)
iconcache.clear()

def manage_updateActionIcon( self
, category
, action_id
, icon_expr
, title
, priority
, REQUEST
):
def manage_updateActionIcon(self, category, action_id, icon_expr, title,
priority, REQUEST):
""" update ActionIcons from ZMI and remove cache entry """
BaseTool.manage_updateActionIcon( self, category, action_id, icon_expr,
title, priority, REQUEST )
BaseTool.manage_updateActionIcon(self, category, action_id, icon_expr,
title, priority, REQUEST)
removeAICacheEntry(category, action_id)

def manage_removeActionIcon( self, category, action_id, REQUEST ):
def manage_removeActionIcon(self, category, action_id, REQUEST):
""" remove ActionIcons from ZMI and remove cache entry """
BaseTool.manage_removeActionIcon(self, category, action_id, REQUEST)
removeAICacheEntry(category, action_id)
Expand Down
12 changes: 6 additions & 6 deletions Products/CMFPlone/ActionsTool.py
Expand Up @@ -119,12 +119,12 @@ def listFilteredActionsFor(self, object=None,
actions.extend(object.listActionInfos(object=object))

# Reorganize the actions by category.
filtered_actions={'user': [],
'folder': [],
'object': [],
'global': [],
'workflow': [],
}
filtered_actions = {'user': [],
'folder': [],
'object': [],
'global': [],
'workflow': [],
}

for action in actions:
catlist = filtered_actions.setdefault(action['category'], [])
Expand Down
19 changes: 10 additions & 9 deletions Products/CMFPlone/CalendarTool.py
Expand Up @@ -11,7 +11,7 @@ class CalendarTool(PloneBaseTool, BaseTool):
security = ClassSecurityInfo()
toolicon = 'skins/plone_images/event_icon.png'

firstweekday = 0 # 0 is Monday
firstweekday = 0 # 0 is Monday

security.declarePublic('getDayNumbers')
def getDayNumbers(self):
Expand All @@ -31,8 +31,8 @@ def getDayNumbers(self):
>>> ctool.getDayNumbers()[0] == fwday
True
"""
firstweekday = self._getCalendar().firstweekday()+1
return [i%7 for i in range(firstweekday, firstweekday + 7)]
firstweekday = self._getCalendar().firstweekday() + 1
return [i % 7 for i in range(firstweekday, firstweekday + 7)]

security.declarePublic('getEventsForCalendar')
def getEventsForCalendar(self, month='1', year='2002', **kw):
Expand All @@ -55,7 +55,7 @@ def getEventsForCalendar(self, month='1', year='2002', **kw):
for week in daysByWeek:
days = []
for day in week:
if events.has_key(day):
if day in events:
days.append(events[day])
else:
days.append({'day': day, 'event': 0, 'eventslist': []})
Expand Down Expand Up @@ -88,8 +88,8 @@ def catalog_getevents(self, year, month, **kw):
query = ctool(**query_args)

# compile a list of the days that have events
eventDays={}
for daynumber in range(1, 32): # 1 to 31
eventDays = {}
for daynumber in range(1, 32): # 1 to 31
eventDays[daynumber] = {'eventslist': [],
'event': 0,
'day': daynumber}
Expand All @@ -99,7 +99,7 @@ def catalog_getevents(self, year, month, **kw):
break
else:
includedevents.append(result.getRID())
event={}
event = {}
# we need to deal with events that end next month
if result.end.month() != month:
# doesn't work for events that last ~12 months
Expand All @@ -120,7 +120,7 @@ def catalog_getevents(self, year, month, **kw):
event['title'] = result.Title or result.getId

if eventStartDay != eventEndDay:
allEventDays = range(eventStartDay, eventEndDay+1)
allEventDays = range(eventStartDay, eventEndDay + 1)
eventDays[eventStartDay]['eventslist'].append(
{'end': None,
'start': result.start.Time(),
Expand All @@ -137,7 +137,8 @@ def catalog_getevents(self, year, month, **kw):
if result.end == result.end.earliestTime():
last_day_data = eventDays[allEventDays[-2]]
last_days_event = last_day_data['eventslist'][-1]
last_days_event['end'] = (result.end-1).latestTime().Time()
last_days_event['end'] = \
(result.end - 1).latestTime().Time()
else:
eventDays[eventEndDay]['eventslist'].append(
{'end': result.end.Time(),
Expand Down
9 changes: 5 additions & 4 deletions Products/CMFPlone/CatalogTool.py
Expand Up @@ -203,7 +203,7 @@ def getObjPositionInParent(obj):
return ordered.getObjectPosition(obj.getId())
return 0

SIZE_CONST = {'kB': 1024, 'MB': 1024*1024, 'GB': 1024*1024*1024}
SIZE_CONST = {'kB': 1024, 'MB': 1024 * 1024, 'GB': 1024 * 1024 * 1024}
SIZE_ORDER = ('GB', 'MB', 'kB')


Expand Down Expand Up @@ -237,9 +237,9 @@ def getObjSize(obj):
if size < SIZE_CONST[smaller]:
return '1 %s' % smaller
for c in SIZE_ORDER:
if size/SIZE_CONST[c] > 0:
if size / SIZE_CONST[c] > 0:
break
return '%.1f %s' % (float(size/float(SIZE_CONST[c])), c)
return '%.1f %s' % (float(size / float(SIZE_CONST[c])), c)
return size


Expand Down Expand Up @@ -467,6 +467,7 @@ def manage_catalogRebuild(self, RESPONSE=None, URL1=None):
URL1 + '/manage_catalogAdvanced?manage_tabs_message=' +
urllib.quote('Catalog Rebuilt\n'
'Total time: %s\n'
'Total CPU time: %s' % (`elapse`, `c_elapse`)))
'Total CPU time: %s'
% (repr(elapse), repr(c_elapse))))

InitializeClass(CatalogTool)
3 changes: 2 additions & 1 deletion Products/CMFPlone/DiscussionTool.py
Expand Up @@ -4,7 +4,8 @@
from Products.CMFPlone.PloneBaseTool import PloneBaseTool
from Products.CMFDefault.permissions import ReplyToItem

from plone.intelligenttext.transforms import convertWebIntelligentPlainTextToHtml
from plone.intelligenttext.transforms \
import convertWebIntelligentPlainTextToHtml


class DiscussionTool(PloneBaseTool, BaseTool):
Expand Down