fixed @//// in wiki and pep8 spacing

This commit is contained in:
mdipierro
2012-08-25 11:29:11 -05:00
parent 0a95246cb0
commit dcce7fc39a
110 changed files with 181 additions and 72 deletions
+12 -11
View File
@@ -1410,9 +1410,9 @@ class Auth(object):
passfield = settings.password_field
extra_fields = settings.extra_fields.get(
settings.table_user_name,[])+signature_list
if username or settings.cas_provider:
if username or settings.cas_provider:
is_unique_username = \
[IS_MATCH('[\w\.\-]+'),
[IS_MATCH('[\w\.\-]+'),
IS_NOT_IN_DB(db,'%s.username' % settings.table_user_name)]
if not settings.username_case_sensitive:
is_unique_username.insert(1,IS_LOWER())
@@ -1584,7 +1584,7 @@ class Auth(object):
'request_reset_password']
from gluon.contrib.login_methods.cas_auth import CasAuth
maps = settings.cas_maps
if not maps:
if not maps:
table_user = self.table_user()
maps = dict((name,lambda v,n=name:v.get(n,None)) for name in \
table_user.fields if name!='id' \
@@ -2476,7 +2476,7 @@ class Auth(object):
separator=self.settings.label_separator
)
if captcha:
addrow(form, captcha.label, captcha, captcha.comment, self.settings.formstyle,'captcha__row')
addrow(form, captcha.label, captcha, captcha.comment, self.settings.formstyle,'captcha__row')
if form.accepts(request, session,
formname='reset_password', dbio=False,
onvalidation=onvalidation,
@@ -3133,7 +3133,7 @@ class Auth(object):
archive_table_name,
Field(current_record,table),
*[field.clone(unique=False) for field in table])
archive_table = table._db[archive_table_name]
archive_table = table._db[archive_table_name]
new_record = {current_record:form.vars.id}
for fieldname in archive_table.fields:
if not fieldname in ['id',current_record]:
@@ -4484,7 +4484,7 @@ class Wiki(object):
def __init__(self,auth,env=None,render='markmin',
manage_permissions=False,force_prefix=''):
self.env = env or {}
self.env['component'] = Wiki.component
self.env['component'] = Wiki.component
if render == 'markmin': render=self.markmin_render
self.auth = auth
if self.auth.user:
@@ -4536,7 +4536,7 @@ class Wiki(object):
not 'wiki_editor' in auth.user_groups.values():
group = db.auth_group(role='wiki_editor')
gid = group.id if group else db.auth_group.insert(role='wiki_editor')
auth.add_membership(gid)
auth.add_membership(gid)
# WIKI ACCESS POLICY
def not_authorized(self,page=None):
raise HTTP(401)
@@ -4604,7 +4604,7 @@ class Wiki(object):
def fix_hostname(self,body):
return body.replace('://HOSTNAME','://%s' % self.host)
def read(self,slug):
if slug in '_cloud': return self.cloud()
elif slug in '_search': return self.search()
@@ -4674,7 +4674,7 @@ class Wiki(object):
def editmedia(self,slug):
auth = self.auth
db = auth.db
db = auth.db
page = db.wiki_page(slug=slug)
if not (page and self.can_edit(page)): return self.not_authorized(page)
self.auth.db.wiki_media.id.represent = lambda id,row:\
@@ -4739,9 +4739,9 @@ class Wiki(object):
for match in regex.finditer(self.fix_hostname(menu_page.body)):
base = match.group('base').replace(' ','')
title = match.group('title')
link = match.group('link')
link = match.group('link')
if link.startswith('@'):
items = link[1:].split('/')
items = link[2:].split('/')
if len(items)>3:
link = URL(a=items[0] or None,c=items[1] or None,f=items[2] or None, args=items[3:])
parent = tree.get(base[1:],tree[''])
@@ -4863,3 +4863,4 @@ if __name__ == '__main__':