Пример #1
0
def main(projectRoot):
   
    print('Creating Tracking Information for %s' %(projectRoot))
    
    codeTreeWalker = FunctionPythonASTIterator(projectRoot)
   
    for picklFilename in codeTreeWalker:
        # FIXME: we should not need to now about the output-name here
        location = picklFilename[:-(len('func_ast.pickl'))]
        print location
        processor = TrackingInformationGenerator()
        processor.reset(location)
        processor.process()
        processor.save()
class TrackingInfoProvider:
    def __init__(self):
        self.trackingInfoGenerator = TrackingInformationGenerator()
        self.cachedTrackingInfos = {}

    def loadTrackingInfo(self, location):
        filename = location + '/tracking_info.pickl'

        if not os.path.exists(filename):
            self._createTrackingInfo(location)

        if filename in self.cachedTrackingInfos:
            return self.cachedTrackingInfos[filename]
        self.cachedTrackingInfos[filename] = pickle.load(file(filename))
        return self.cachedTrackingInfos[filename]

    def _createTrackingInfo(self, location):
        self.trackingInfoGenerator.reset(location)
        self.trackingInfoGenerator.process()
        self.trackingInfoGenerator.save()
Пример #3
0
class TrackingInfoProvider:
    def __init__(self):
        self.trackingInfoGenerator = TrackingInformationGenerator()
        self.cachedTrackingInfos = {}
    
    def loadTrackingInfo(self, location):
        filename = location + '/tracking_info.pickl'
        
        if not os.path.exists(filename):
            self._createTrackingInfo(location)
        
        if filename in self.cachedTrackingInfos:
            return self.cachedTrackingInfos[filename]
        self.cachedTrackingInfos[filename] = pickle.load(file(filename))
        return self.cachedTrackingInfos[filename]
    
    def _createTrackingInfo(self, location):
        self.trackingInfoGenerator.reset(location)
        self.trackingInfoGenerator.process()
        self.trackingInfoGenerator.save()
 def __init__(self):
     self.trackingInfoGenerator = TrackingInformationGenerator()
     self.cachedTrackingInfos = {}
Пример #5
0
 def __init__(self):
     self.trackingInfoGenerator = TrackingInformationGenerator()
     self.cachedTrackingInfos = {}