From 2f5b288e5a45ea301cd9dbcfbd175a48065a577e Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 10 Jun 2018 08:25:18 +0900 Subject: [PATCH] =?utf8?q?PEP8=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/Python/DataReader.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/Python/DataReader.py b/src/main/Python/DataReader.py index 6818e6a..3975be8 100644 --- a/src/main/Python/DataReader.py +++ b/src/main/Python/DataReader.py @@ -2,15 +2,16 @@ import os import Data import yaml + class DataReader: - DATA_SOURCE ="" + DATA_SOURCE = "" def __init__(self): - with open('config\\toolconf.yml','r') as config: + with open('config\\toolconf.yml', 'r') as config: confdata = yaml.load(config) self.DATA_SOURCE = confdata['dataPath'] - def createLearningData(self): + def parse_data_files(self): data = [] for file in self.walkDataDirectory(self.DATA_SOURCE): @@ -18,14 +19,13 @@ class DataReader: return data - #FIXME このメソッド間違えてる - def walkDataDirectory(self,directory): - for root,dirs,files in os.walk(directory): + def walkDataDirectory(self, directory): + for root, dirs, files in os.walk(directory): for file in files: yield os.path.join(root,file) - def read(self,file): + def read(self, file: str): result = Data.Data() if os.path.isfile(file): datafile = open(file) @@ -39,5 +39,6 @@ class DataReader: line_data = orgdata[i].replace("\n","") data.append(line_data.split(',')) result.setData(data) + result.set_org_data(file) - return result \ No newline at end of file + return result -- 2.11.0