galaxy-obo / lib / galaxy / util / none_like.py

The default branch has multiple heads

"""
Objects with No values
"""
from galaxy.datatypes.metadata import MetadataCollection
from galaxy.datatypes.registry import Registry

class RecursiveNone:
    def __str__( self ):
        return "None"
    def __repr__( self ):
        return str( self )
    def __getattr__( self, name ):
        value = RecursiveNone()
        setattr( self, name, value )
        return value
    def __nonzero__( self ):
        return False

class NoneDataset( RecursiveNone ):
    def __init__( self, datatypes_registry = None, ext = 'data', dbkey = '?' ):
        self.ext = self.extension = ext
        self.dbkey = dbkey
        if datatypes_registry is None:
            # Default Value Required for unit tests
            datatypes_registry = Registry()
            datatypes_registry.load_datatypes()
        self.datatype = datatypes_registry.get_datatype_by_extension( ext )
        self._metadata = None
        self.metadata = MetadataCollection( self )
    def __getattr__( self, name ):
        return "None"
    def missing_meta( self ):
        return False
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.