Commit 82184a43 authored by Grzegorz Kostkowski's avatar Grzegorz Kostkowski

Fix issue with path in plugin

parent 75fe7153
......@@ -6,6 +6,8 @@ from os.path import isfile, isdir, join, split
import codecs
import keyword_assignment_tool.keyword_assignment_pmc as run
from keyword_assignment_tool.utils.utils import as_str
class KwazonPlugin(object):
def __init__(self,
......@@ -418,18 +420,20 @@ def get_config_file_path():
def _make_out_paths(path, extra_text='', new_dir=None, with_debug=False):
'''Tiny function to facilitate handling paths inputed to run_kwazon_prepared_debug
method. If new_dir is given then changes directory of resulted paths.'''
working_path = path[:]
working_path = as_str(path[:])
if new_dir and isdir(new_dir):
working_dir, file_name = split(path)
if not working_dir: # path is relative
working_dir = getcwd()
else:
working_dir = new_dir
file_name = as_str(file_name)
working_dir = as_str(working_dir)
working_path = "{}/{}".format(working_dir, file_name)
if working_path.endswith('.xml'):
working_path = working_path[:-4]
if with_debug:
return path, working_path + extra_text + '-keywords.json',\
return as_str(path), working_path + extra_text + '-keywords.json',\
working_path + extra_text + '-ranking.txt',\
working_path + extra_text + '-debug.txt'
else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment