support unicode chars in project name and column names
This commit is contained in:
parent
18a4d68b5c
commit
505a62afc2
|
@ -194,12 +194,12 @@ def info(project_id):
|
||||||
'/project?project=' + project_id))
|
'/project?project=' + project_id))
|
||||||
for k, v in projects_info.items():
|
for k, v in projects_info.items():
|
||||||
if v:
|
if v:
|
||||||
print('{0:>20}: {1}'.format(k, v))
|
print(u'{0:>20}: {1}'.format(k, v))
|
||||||
project_model = project.get_models()
|
project_model = project.get_models()
|
||||||
column_model = project_model['columnModel']
|
column_model = project_model['columnModel']
|
||||||
columns = [column['name'] for column in column_model['columns']]
|
columns = [column['name'] for column in column_model['columns']]
|
||||||
for (i, v) in enumerate(columns, start=1):
|
for (i, v) in enumerate(columns, start=1):
|
||||||
print('{0:>20}: {1}'.format('column ' + str(i).zfill(3), v))
|
print(u'{0:>20}: {1}'.format('column ' + str(i).zfill(3), v))
|
||||||
else:
|
else:
|
||||||
print('Error: No project found with id %s.\n'
|
print('Error: No project found with id %s.\n'
|
||||||
'Check existing projects with command --list' % (project_id))
|
'Check existing projects with command --list' % (project_id))
|
||||||
|
@ -215,7 +215,7 @@ def ls():
|
||||||
projects.sort(key=lambda v: date_to_epoch(v[1]['modified']), reverse=True)
|
projects.sort(key=lambda v: date_to_epoch(v[1]['modified']), reverse=True)
|
||||||
if projects:
|
if projects:
|
||||||
for project_id, project_info in projects:
|
for project_id, project_info in projects:
|
||||||
print('{0:>14}: {1}'.format(project_id, project_info['name']))
|
print(u'{0:>14}: {1}'.format(project_id, project_info['name']))
|
||||||
else:
|
else:
|
||||||
print('Error: No projects found')
|
print('Error: No projects found')
|
||||||
|
|
||||||
|
|
|
@ -429,15 +429,17 @@ class RefineProject:
|
||||||
|
|
||||||
def export(self, export_format='tsv'):
|
def export(self, export_format='tsv'):
|
||||||
"""Return a fileobject of a project's data."""
|
"""Return a fileobject of a project's data."""
|
||||||
url = ('export-rows/' + urllib.quote(self.project_name()) + '.' +
|
url = ('export-rows/' +
|
||||||
export_format)
|
urllib.quote(self.project_name().encode('utf8')) +
|
||||||
|
'.' + export_format)
|
||||||
return self.do_raw(url, data={'format': export_format})
|
return self.do_raw(url, data={'format': export_format})
|
||||||
|
|
||||||
def export_templating(self, engine='', prefix='',
|
def export_templating(self, engine='', prefix='',
|
||||||
template='', rowSeparator='\n', suffix=''):
|
template='', rowSeparator='\n', suffix=''):
|
||||||
"""Return a fileobject of a project's data in templating mode."""
|
"""Return a fileobject of a project's data in templating mode."""
|
||||||
url = ('export-rows/' + urllib.quote(self.project_name()) + '.' +
|
url = ('export-rows/' +
|
||||||
'txt')
|
urllib.quote(self.project_name().encode('utf8')) +
|
||||||
|
'.' + 'txt')
|
||||||
return self.do_raw(url, data={'format': 'template',
|
return self.do_raw(url, data={'format': 'template',
|
||||||
'template': template,
|
'template': template,
|
||||||
'engine': engine,
|
'engine': engine,
|
||||||
|
|
Loading…
Reference in New Issue