Example #1
0
class DastFile(ObjectFile):
    def __init__(self, filename, mode = 'r', cls = File, flush = 0, emptylines = 0, **dastArgs):
        super(DastFile, self).__init__(filename, cls, flush, emptylines, mode = mode)
        self.dast = DAST(**dastArgs)

    def _write(self, item):
        self.dast.dump(item, self.file, newline = True)
        
    def _read(self):
        return self.dast.decode(self.file.file)
Example #2
0
    def __init__(self,
                 filename,
                 mode='r',
                 cls=File,
                 flush=0,
                 emptylines=0,
                 **dastArgs):
        super(DastFile, self).__init__(filename,
                                       cls,
                                       flush,
                                       emptylines,
                                       mode=mode)

        from nifty.data.dast import DAST
        self.dast = DAST(**dastArgs)
Example #3
0
class DastFile(ObjectFile):
    def __init__(self,
                 filename,
                 mode='r',
                 cls=File,
                 flush=0,
                 emptylines=0,
                 **dastArgs):
        super(DastFile, self).__init__(filename,
                                       cls,
                                       flush,
                                       emptylines,
                                       mode=mode)

        from nifty.data.dast import DAST
        self.dast = DAST(**dastArgs)

    def _write(self, item):
        self.dast.dump(item, self.file, newline=True)

    def _read(self):
        return self.dast.decode(self.file.file)
Example #4
0
 def __init__(self, filename, mode = 'r', cls = File, flush = 0, emptylines = 0, **dastArgs):
     super(DastFile, self).__init__(filename, cls, flush, emptylines, mode = mode)
     self.dast = DAST(**dastArgs)