# Path: pyvmd/collectors.py
# class Collector(object):
#     """
#     Base class for collectors. Collects data from trajectory and writes them into file.
#     """
#     # Format of the column header in the output
#     header_fmt = '%10s'
#     # Format of the data in the output
#     data_fmt = '%10.4f'
# 
#     # Counter for automatic name generation.
#     auto_name_counter = 0
# 
#     def __init__(self, name=None):
#         """
#         Create the collector.
# 
#         @param name: Name of the collector. If not provided, it is generated in form 'data#####'.
#         """
#         if name is None:
#             Collector.auto_name_counter += 1
#             name = 'data%05d' % Collector.auto_name_counter
#         self.name = name
# 
#     def collect(self, step):
#         """
#         Performs the analysis on the frame.
# 
#         Derived class must implement this method.
#         """
#         raise NotImplementedError


import difflib
import os
import pprint
import unittest
import VMD
from unittest.util import safe_repr
from pyvmd.collectors import Collector
"""
Utilities for tests.
"""




def data(filename):
    """
    Return full filename of the test datafile.
    """
    return os.path.join(os.path.dirname(__file__), 'data', filename)


class PyvmdTestCase(unittest.TestCase):
    """
    Enhanced test case for pyvmd tests.
    """
    def tearDown(self):
        # Delete all molecule when we're finished
        for molid in VMD.molecule.listall():
            VMD.molecule.delete(molid)
        # Restore Collector's auto_name_counter

# Path: pyvmd/collectors.py
# class Collector(object):
#     """
#     Base class for collectors. Collects data from trajectory and writes them into file.
#     """
#     # Format of the column header in the output
#     header_fmt = '%10s'
#     # Format of the data in the output
#     data_fmt = '%10.4f'
# 
#     # Counter for automatic name generation.
#     auto_name_counter = 0
# 
#     def __init__(self, name=None):
#         """
#         Create the collector.
# 
#         @param name: Name of the collector. If not provided, it is generated in form 'data#####'.
#         """
#         if name is None:
#             Collector.auto_name_counter += 1
#             name = 'data%05d' % Collector.auto_name_counter
#         self.name = name
# 
#     def collect(self, step):
#         """
#         Performs the analysis on the frame.
# 
#         Derived class must implement this method.
#         """
#         raise NotImplementedError


# Path: pyvmd/tests/utils.py
import difflib
import os
import pprint
import unittest
import VMD
from unittest.util import safe_repr
from pyvmd.collectors import Collector

"""
Utilities for tests.
"""




def data(filename):
    """
    Return full filename of the test datafile.
    """
    return os.path.join(os.path.dirname(__file__), 'data', filename)


class PyvmdTestCase(unittest.TestCase):
    """
    Enhanced test case for pyvmd tests.
    """
    def tearDown(self):
        # Delete all molecule when we're finished
        for molid in VMD.molecule.listall():
            VMD.molecule.delete(molid)
        # Restore Collector's auto_name_counter

        Collector.auto_name_counter = 0