some more Python3 fixes
This commit is contained in:
parent
78c8b196bf
commit
8a578b46a8
4 changed files with 7 additions and 6 deletions
|
@ -2,7 +2,7 @@
|
|||
set -a
|
||||
|
||||
# use environment variables for instance-specific configuration:
|
||||
#ZOPE_CONF=zope-1.conf
|
||||
#SERVER_ID=0
|
||||
#LOOPS_PATH=sites/mysite
|
||||
|
||||
python -ic "from loops.server import psu; psu.setup()"
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
""" Utilities.
|
||||
"""
|
||||
|
||||
import re, urllib
|
||||
import re
|
||||
import urllib.parse
|
||||
from zope.browserpage import ViewPageTemplateFile
|
||||
from zope.browsermenu.menu import BrowserMenu
|
||||
from zope.browsermenu.interfaces import IBrowserSubMenuItem
|
||||
|
@ -51,4 +52,4 @@ def html_quote(text, character_entities=((u'&', u'&'), (u'<', u'<' ),
|
|||
pattern = re.compile(r'[ /\?\+\|%]')
|
||||
|
||||
def normalizeForUrl(text):
|
||||
return urllib.quote(pattern.sub('-', text).encode('UTF-8'))
|
||||
return urllib.parse.quote(pattern.sub('-', text).encode('UTF-8'))
|
||||
|
|
|
@ -31,7 +31,7 @@ class Presence(object):
|
|||
|
||||
def removeInactiveUsers(self):
|
||||
toDelete = []
|
||||
for id, timeStamp in self.presentUsers.iteritems():
|
||||
for id, timeStamp in self.presentUsers.items():
|
||||
if (getTimeStamp() - timeStamp) > (self.min_until_logout*60):
|
||||
toDelete.append(id)
|
||||
for id in toDelete:
|
||||
|
@ -40,7 +40,7 @@ class Presence(object):
|
|||
|
||||
def getPresentUsers(self, context=None):
|
||||
ret = []
|
||||
for id, timeStamp in self.presentUsers.iteritems():
|
||||
for id, timeStamp in self.presentUsers.items():
|
||||
principal = util.getPrincipalForUserId(id)
|
||||
person = getPersonForUser(context, principal=principal)
|
||||
ret.append(person or principal)
|
||||
|
|
|
@ -496,7 +496,7 @@ class DocumentReadFileAdapter(object):
|
|||
|
||||
def read(self):
|
||||
data = self.data
|
||||
if type(data) is unicode:
|
||||
if type(data) is str:
|
||||
return self.data.encode('UTF-8')
|
||||
else:
|
||||
return data
|
||||
|
|
Loading…
Add table
Reference in a new issue