From aaad4003a94b66b07118b7f20d9f908cc6569be2 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Sun, 1 Dec 2019 21:32:47 -0600 Subject: [PATCH] bug fix --- transport/disk.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/transport/disk.py b/transport/disk.py index d110f23..be17550 100644 --- a/transport/disk.py +++ b/transport/disk.py @@ -20,8 +20,8 @@ class DiskReader(Reader) : return os.path.exists(self.path) def read(self,size=-1): """ - This function reads the rows from a designated location on disk - @param size number of rows to be read, -1 suggests all rows + This function reads the rows from a designated location on disk + @param size number of rows to be read, -1 suggests all rows """ f = open(self.path,'rU') @@ -47,8 +47,8 @@ class DiskWriter(Writer): self.name = params['name']; else: self.name = 'out.log' - if os.path.exists(self.path) == False: - os.mkdir(self.path) + # if os.path.exists(self.path) == False: + # os.mkdir(self.path) def isready(self): """ @@ -66,20 +66,20 @@ class DiskWriter(Writer): @param row row to be written """ - label = params['label'] + # label = params['label'] row = params['row'] - xchar = None - if 'xchar' is not None: - xchar = params['xchar'] + # xchar = None + # if 'xchar' is not None: + # xchar = params['xchar'] #path = ''.join([self.path,os.sep,label]) - path = ''.join([self.path,os.sep,self.name]) + # path = ''.join([self.path,os.sep,self.name]) #if os.path.exists(path) == False: # os.mkdir(path) ; - path = ''.join([path,os.sep,self.name]) - f = open(path,'a') - if isinstance(row,object): - row = json.dumps(row) + # path = ''.join([path,os.sep,self.name]) + f = open(self.path,'a') + if isinstance(row,object): + row = json.dumps(row) #row = self.format(row,xchar); - f.write(row) + f.write(row+"\n") f.close()