00001 __copyright__ = """
00002 Copyright 2008 Sean Ross-Ross
00003 """
00004 __license__ = """
00005 This file is part of SLIMpy .
00006
00007 SLIMpy is free software: you can redistribute it and/or modify
00008 it under the terms of the GNU Lesser General Public License as published by
00009 the Free Software Foundation, either version 3 of the License, or
00010 (at your option) any later version.
00011
00012 SLIMpy is distributed in the hope that it will be useful,
00013 but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015 GNU Lesser General Public License for more details.
00016
00017 You should have received a copy of the GNU Lesser General Public License
00018 along with SLIMpy . If not, see <http://www.gnu.org/licenses/>.
00019 """
00020
00021 from slimpy_base.Core.Interface.ContainerBase import DataContainer
00022 from os.path import isfile
00023 from slimpy_base.api.Plugins.slim2su.SU_ScalarMethods import SU_ScalarMethods
00024
00025 class SU_DataContainer( DataContainer ):
00026
00027 _scalar_methods = SU_ScalarMethods
00028 @staticmethod
00029 def isCompatibleWith( obj ):
00030 '''
00031 statict method to determine if 'obj' is an su file
00032 @param obj:
00033 @type obj: any object that would be
00034 contained in a datacontainer class
00035 '''
00036
00037 obj = str(obj)
00038
00039 if obj.endswith( ".su" ):
00040 if not isfile( obj ):
00041 raise Exception, "the file %s can not be found" %( obj )
00042 return True
00043 if isfile( obj+".su" ):
00044 return True
00045
00046 return False
00047
00048 def getConverter( self , command ):
00049 '''
00050 return converter class
00051
00052 command must have attribute 'function'
00053 '''
00054
00055 raise NotImplementedError
00056
00057
00058 def setName( self, newname ):
00059 'set the name of the data, perform a move command if neccisary'
00060 raise NotImplementedError
00061
00062 def isempty( self ):
00063 'is the data on disk'
00064 raise NotImplementedError
00065
00066
00067
00068
00069
00070
00071