fix unicode issues

This commit is contained in:
Romain Bignon 2011-10-03 20:57:51 +02:00
commit e68ec1d6e5
2 changed files with 6 additions and 6 deletions

View file

@ -71,7 +71,7 @@ class WebContentEdit(ReplApplication):
content.content = u''
data = ''
f.write(data)
paths[path] = content
paths[path.encode('utf-8')] = content
params = ''
editor = os.environ.get('EDITOR', 'vim')
@ -105,7 +105,7 @@ class WebContentEdit(ReplApplication):
errors = CallErrors([])
for content in contents:
path = [path for path, c in paths.iteritems() if c == content][0]
sys.stdout.write('Pushing %s...' % content.id)
sys.stdout.write('Pushing %s...' % content.id.encode('utf-8'))
sys.stdout.flush()
try:
self.do('push_content', content, message, minor=minor, backends=[content.backend]).wait()

View file

@ -87,19 +87,19 @@ class RedmineBrowser(BaseBrowser):
return self._userid
def get_wiki_source(self, project, page):
self.location('%s/projects/%s/wiki/%s/edit' % (self.BASEPATH, project, page))
self.location('%s/projects/%s/wiki/%s/edit' % (self.BASEPATH, project, urllib.quote(page.encode('utf-8'))))
return self.page.get_source()
def set_wiki_source(self, project, page, data, message):
self.location('%s/projects/%s/wiki/%s/edit' % (self.BASEPATH, project, page))
self.location('%s/projects/%s/wiki/%s/edit' % (self.BASEPATH, project, urllib.quote(page.encode('utf-8'))))
self.page.set_source(data, message)
def get_wiki_preview(self, project, page, data):
if (not self.is_on_page(WikiEditPage) or self.page.groups[0] != project
or self.page.groups[1] != page):
self.location('%s/projects/%s/wiki/%s/edit' % (self.BASEPATH,
project, page))
url = '%s/projects/%s/wiki/%s/preview' % (self.BASEPATH, project, page)
project, urllib.quote(page.encode('utf-8'))))
url = '%s/projects/%s/wiki/%s/preview' % (self.BASEPATH, project, urllib.quote(page.encode('utf-8')))
params = {}
params['content[text]'] = data.encode('utf-8')
params['authenticity_token'] = "%s" % self.page.get_authenticity_token()