Beispiel #1
0
def get_bitmap(root, name):
    """ 
    Convenience function that returns a bitmap
    root - either an instance of a class or a path 
    name - name of png file to load
    """
    path = os.path.join(get_path(root), name)
    bmp = wx.Bitmap(path, wx.BITMAP_TYPE_PNG)
    return bmp
Beispiel #2
0
def get_bitmap(root, name):
    """ 
    Convenience function that returns a bitmap
    root - either an instance of a class or a path 
    name - name of png file to load
    """
    path = os.path.join(get_path(root), name)
    bmp = wx.Bitmap(path, wx.BITMAP_TYPE_PNG)
    return bmp
    def _get_default_resource_path(self, object):
        """ Returns the default resource path for an object. """

        resource_path = []
        for klass in inspect.getmro(object.__class__):
            try:
                resource_path.append(get_path(klass))

            # We get an attribute error when we get to a C extension type (in
            # our case it will most likley be 'CHasTraits'.  We simply ignore
            # everything after this point!
            except AttributeError:
                break

        return resource_path
Beispiel #4
0
    def _get_default_resource_path(self, object):
        """ Returns the default resource path for an object. """

        resource_path = []
        for klass in inspect.getmro(object.__class__):
            try:
                resource_path.append(get_path(klass))

            # We get an attribute error when we get to a C extension type (in
            # our case it will most likley be 'CHasTraits'.  We simply ignore
            # everything after this point!
            except AttributeError:
                break

        return resource_path
Beispiel #5
0
 def test_file_path(self):
     """
         Run 'check_file_path.py' as a spawned process and test
         return value,
         The python source is stored into a temporary test file before
         being executed in a subprocess.
     """
     store_resource('AppTools',
                    os.path.join('enthought', 'persistence','tests',
                                 'check_file_path.py'),
                    self.tmpname)
     
     retcode = subprocess.call([sys.executable, self.tmpname],
                               cwd=get_path(Tests))
     
     self.assertEqual(retcode, 0)
Beispiel #6
0
    def test_file_path(self):
        """
            Run 'check_file_path.py' as a spawned process and test
            return value,
            The python source is stored into a temporary test file before
            being executed in a subprocess.
        """
        store_resource(
            'AppTools',
            os.path.join('enthought', 'persistence', 'tests',
                         'check_file_path.py'), self.tmpname)

        retcode = subprocess.call([sys.executable, self.tmpname],
                                  cwd=get_path(Tests))

        self.assertEqual(retcode, 0)