fix unicode issues
This commit is contained in:
parent
01c9d1ded8
commit
e68ec1d6e5
2 changed files with 6 additions and 6 deletions
|
|
@ -71,7 +71,7 @@ class WebContentEdit(ReplApplication):
|
||||||
content.content = u''
|
content.content = u''
|
||||||
data = ''
|
data = ''
|
||||||
f.write(data)
|
f.write(data)
|
||||||
paths[path] = content
|
paths[path.encode('utf-8')] = content
|
||||||
|
|
||||||
params = ''
|
params = ''
|
||||||
editor = os.environ.get('EDITOR', 'vim')
|
editor = os.environ.get('EDITOR', 'vim')
|
||||||
|
|
@ -105,7 +105,7 @@ class WebContentEdit(ReplApplication):
|
||||||
errors = CallErrors([])
|
errors = CallErrors([])
|
||||||
for content in contents:
|
for content in contents:
|
||||||
path = [path for path, c in paths.iteritems() if c == content][0]
|
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()
|
sys.stdout.flush()
|
||||||
try:
|
try:
|
||||||
self.do('push_content', content, message, minor=minor, backends=[content.backend]).wait()
|
self.do('push_content', content, message, minor=minor, backends=[content.backend]).wait()
|
||||||
|
|
|
||||||
|
|
@ -87,19 +87,19 @@ class RedmineBrowser(BaseBrowser):
|
||||||
return self._userid
|
return self._userid
|
||||||
|
|
||||||
def get_wiki_source(self, project, page):
|
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()
|
return self.page.get_source()
|
||||||
|
|
||||||
def set_wiki_source(self, project, page, data, message):
|
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)
|
self.page.set_source(data, message)
|
||||||
|
|
||||||
def get_wiki_preview(self, project, page, data):
|
def get_wiki_preview(self, project, page, data):
|
||||||
if (not self.is_on_page(WikiEditPage) or self.page.groups[0] != project
|
if (not self.is_on_page(WikiEditPage) or self.page.groups[0] != project
|
||||||
or self.page.groups[1] != page):
|
or self.page.groups[1] != page):
|
||||||
self.location('%s/projects/%s/wiki/%s/edit' % (self.BASEPATH,
|
self.location('%s/projects/%s/wiki/%s/edit' % (self.BASEPATH,
|
||||||
project, page))
|
project, urllib.quote(page.encode('utf-8'))))
|
||||||
url = '%s/projects/%s/wiki/%s/preview' % (self.BASEPATH, project, page)
|
url = '%s/projects/%s/wiki/%s/preview' % (self.BASEPATH, project, urllib.quote(page.encode('utf-8')))
|
||||||
params = {}
|
params = {}
|
||||||
params['content[text]'] = data.encode('utf-8')
|
params['content[text]'] = data.encode('utf-8')
|
||||||
params['authenticity_token'] = "%s" % self.page.get_authenticity_token()
|
params['authenticity_token'] = "%s" % self.page.get_authenticity_token()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue