Commit 9f97d9f40876698ba8a59960e24c91a5e2516336
1 parent
021e2c5e
Exists in
master
and in
1 other branch
Corrige path do AplicadorRegras e WorkCSV
Showing
2 changed files
with
15 additions
and
3 deletions
Show diff stats
src/AplicadorRegras.py
... | ... | @@ -5,12 +5,19 @@ |
5 | 5 | |
6 | 6 | import xml.etree.ElementTree as ET |
7 | 7 | from os.path import expanduser |
8 | +import platform | |
8 | 9 | |
9 | 10 | class AplicadorRegras(object): |
10 | 11 | |
11 | 12 | # inicializacao das variaves |
12 | 13 | def __init__(self): |
13 | - self.__tree = ET.parse(expanduser("~")+'/vlibras-translate/data/regras.xml') | |
14 | + | |
15 | + so = platform.system() | |
16 | + if so == 'Windows': | |
17 | + self.__tree = ET.parse(expanduser("~")+'\\vlibras-translate\data\\regras.xml') | |
18 | + else: | |
19 | + self.__tree = ET.parse(expanduser("~")+'/vlibras-translate/data/regras.xml') | |
20 | + | |
14 | 21 | self.__root = self.__tree.getroot() |
15 | 22 | self.__tAux = [] |
16 | 23 | self.__dAux = {} | ... | ... |
src/WorkCSV.py
... | ... | @@ -3,7 +3,7 @@ |
3 | 3 | |
4 | 4 | #Autor: Erickson Silva <erickson.silva@lavid.ufpb.br> <ericksonsilva@live.com> |
5 | 5 | |
6 | -import csv | |
6 | +import csv, platform | |
7 | 7 | from os.path import expanduser |
8 | 8 | |
9 | 9 | class WorkCSV(object): |
... | ... | @@ -11,7 +11,12 @@ class WorkCSV(object): |
11 | 11 | # Define e inicializa os atributos |
12 | 12 | def __init__(self): |
13 | 13 | |
14 | - self.__path = expanduser("~") + "/vlibras-translate/data/" | |
14 | + so = platform.system() | |
15 | + if so == 'Windows': | |
16 | + self.__path = expanduser("~") + "\\vlibras-translate\data\\" | |
17 | + else: | |
18 | + self.__path = expanduser("~") + "/vlibras-translate/data/" | |
19 | + | |
15 | 20 | self.__fileInf = '' |
16 | 21 | self.__dicInf = {} |
17 | 22 | self.__fileSin = '' | ... | ... |