Beispiel #1
0
def main():
    """
    Simple demonstration program to show different usages. Comment and uncomment parsers 
    and output streams to try out different combinations. The system is made by using the 
    decorator pattern, so apart from PickleOut, any parser sould be combineable with any 
    output. If you want you should even be able to make decorators to your parsers.
    """

    # List of files to parse
    fileList = ['runPySmell.py']

    # Set the output to use
    outputStream = PrintOut()
    #outputStream = FileOut('somefile')
    
    # Set the parser
    parser = EvalParser(outputStream)
    #parser = PickleOut('somefile') # Be aware, currently pickle out serves as both parser and output stream

    # Get the modules
    modules = process(fileList)

    # Run the task :)
    parser.write(modules)
Beispiel #2
0
def main():
    """
    Simple demonstration program to show different usages. Comment and uncomment parsers 
    and output streams to try out different combinations. The system is made by using the 
    decorator pattern, so apart from PickleOut, any parser sould be combineable with any 
    output. If you want you should even be able to make decorators to your parsers.
    """

    # List of files to parse
    fileList = ['runPySmell.py']

    # Set the output to use
    outputStream = PrintOut()
    #outputStream = FileOut('somefile')

    # Set the parser
    parser = EvalParser(outputStream)
    #parser = PickleOut('somefile') # Be aware, currently pickle out serves as both parser and output stream

    # Get the modules
    modules = process(fileList)

    # Run the task :)
    parser.write(modules)
Beispiel #3
0
 def testOptionalOutput(self):
     modules = tags.process(['TestData/PackageA'], [], verbose=True)
     self.assertTrue(isinstance(modules, ModuleDict),
                     'did not return modules')
     self.assertDictsEqual(modules, self.packageA)
Beispiel #4
0
 def testOptionalOutput(self):
     modules = tags.process(['TestData/PackageA'], [], verbose=True)
     self.assertTrue(isinstance(modules, ModuleDict), 'did not return modules')
     self.assertDictsEqual(modules, self.packageA)