# Class e.p.g.g.GnomevfsMedia(MediaProvider):

Part of elisa.plugins.gvfs.gnomevfs_media View In Hierarchy

Undocumented

Line # | Kind | Name | Docs
--- | --- | --- | ---
37 | Method | __init__ | Undocumented
65 | Method | initialize | Initialize the component.
80 | Method | supported_uri_schemes__get | Retrieve the URI schemes supported by the provider, for each
83 | Method | scannable_uri_schemes__get | Retrieve the URI schemes that can be scanned by the
86 | Method | is_directory | Same as `_blocking_is_directory` but without blocking (in
114 | Method | has_children_with_types | Same as `_blocking_has_children_with_types` but without blocking (in
152 | Method | get_media_type | Same as `blocking_get_media_type` but without blocking (in
169 | Method | get_direct_children | Same as `_blocking_get_direct_children` but without blocking (in
193 | Method | open | Same as `_blocking_open` but without blocking (in
214 | Method | clean | Clean the component.
217 | Method | next_location | Same as `_blocking_next_location` but without blocking (in
221 | Method | read | Same as `_blocking_seek` but without blocking (in

Inherited from MediaProvider:

Line # | Kind | Name | Docs
--- | --- | --- | ---
112 | Method | get_real_uri | Returns the original uri (acesable) from a virtual
286 | Method | close | Same as `_blocking_close` but without blocking (in
298 | Method | _blocking_close | Close a MediaFile
308 | Method | seek | Same as `_blocking_seek` but without blocking (in
325 | Method | _blocking_seek | Seek data in a MediaFile
399 | Method | previous_location | Same as `_blocking_previous_location` but without blocking (in
422 | Method | monitor_uri | Start monitoring given uri for modification and call a
441 | Method | unmonitor_uri | Stop monitoring given uri.
450 | Method | uri_is_monitorable | Check if the uri is monitorable for modification
461 | Method | uri_is_monitored | Check if the uri is currently monitored for modification
473 | Method | copy | Copy one location to another. If both URIs represent a
492 | Method | move | Move data located at given URI to another URI. If orig_uri
509 | Method | delete | Delete a resource located at given URI. If that URI represents

Inherited from Component (via MediaProvider):

Line # | Kind | Name | Docs
--- | --- | --- | ---
85 | Class | PathDescriptor | Undocumented
97 | Class Method | create | Create and initialize the component.

def __init__(self):
overrides elisa.core.log.Loggable.__init__
Undocumented
def initialize(self):
overrides elisa.core.component.Component.initialize

Initialize the component.

This method is called by `Component.create` to finish the initialization of a component.

Returns | a deferred called when a component is fully initialized (type: `twisted.internet.defer.Deferred` )

def supported_uri_schemes__get(self):
overrides elisa.core.components.media_provider.MediaProvider.supported_uri_schemes__get

Retrieve the URI schemes supported by the provider, for each scheme there's a priority. Higher priority == 0 means the provider will always be used to read data from a given scheme.

This function is called by the MediaManager to know which media provider it has to use to access a specified URI. You should return a dict containing the uri scheme (such as 'file', 'cdda', ...) and its priority between 0 to 255 (0 being the topmost priority). The prority is used by the MediaManager to know which media provider it should use in case there are more than one who support the desired uri scheme. You might have for example a component which supports more than one scheme, but the support of one of them is not very efficient compared to what it could be. In this case you could modify its priority to tell the MediaManager that another component should be used instead of it to access this scheme.

example: { 'file': 0, 'smb': 10 }

# FIXME: this should be documented in the class docstring as a class # variable

def scannable_uri_schemes__get(self):
overrides elisa.core.components.media_provider.MediaProvider.scannable_uri_schemes__get

Retrieve the URI schemes that can be scanned by the media_scanner. Since media scanning can be an heavy and long task the MediaProvider developer can choose to make the media_scanner skip URIs with scheme not appearing in returned list.

By default the return value of this method corresponds to the keys of `supported_uri_schemes__get` return value.

# FIXME: this should be documented in the class docstring as a class # variable

def is_directory(self, uri):
overrides elisa.core.components.media_provider.MediaProvider.is_directory
Same as `_blocking_is_directory` but without blocking (in theory). This method by default triggers a succeeded callback on a Twisted deferred, using `_blocking_is_directory` result.

Parameters | uri | the URI to analyze (type: `elisa.core.media_uri.MediaUri` )
Returns | (type: `twisted.internet.defer.Deferred` )

def has_children_with_types(self, uri, media_types):
overrides elisa.core.components.media_provider.MediaProvider.has_children_with_types
Same as `_blocking_has_children_with_types` but without blocking (in theory). This method by default triggers a succeeded callback on a Twisted deferred, using `_blocking_has_children_with_types` result.

Parameters | uri | the URI to scan (type: `elisa.core.media_uri.MediaUri` )
| media_types | the media_types to look for on the directory (type: list of strings )
Returns | (type: `twisted.internet.defer.Deferred` )

def get_media_type(self, uri):
overrides elisa.core.components.media_provider.MediaProvider.get_media_type
Same as `blocking_get_media_type` but without blocking (in theory). This method by default triggers a succeeded callback on a Twisted deferred, using `blocking_get_media_type` result.

Parameters | uri | the URI to analyze (type: `elisa.core.media_uri.MediaUri` )
Returns | (type: `twisted.internet.defer.Deferred` )

def get_direct_children(self, uri, children_with_info):
overrides elisa.core.components.media_provider.MediaProvider.get_direct_children
Same as `_blocking_get_direct_children` but without blocking (in theory). This method by default triggers a succeeded callback on a Twisted deferred, using `_blocking_get_direct_children` result.

Parameters | uri | the URI to analyze (type: `elisa.core.media_uri.MediaUri` )
| children_with_info | List where the children will be appended (type: list )
Returns | (type: `twisted.internet.defer.Deferred` )

def open(self, uri, mode='r'):
overrides elisa.core.components.media_provider.MediaProvider.open
Same as `_blocking_open` but without blocking (in theory). This method by default triggers a succeeded callback on a Twisted deferred, using `_blocking_open` result.

Parameters | uri | the URI to open (type: `elisa.core.media_uri.MediaUri` )
| mode | how to open the file -- see manual of builtin open() (type: string or None )
Returns | (type: `twisted.internet.defer.Deferred` )
Note | It's not allowed to open directories, it's up to the developer to check that the URI to open doesn't represent a directory.

def clean(self):
overrides elisa.core.component.Component.clean

Clean the component.

This method is called when a component is not needed anymore to clean its state.

Returns | a deferred called when the component has finished cleaning its state (type: `twisted.internet.defer.Deferred` )

def next_location(self, uri, root=None):
overrides elisa.core.components.media_provider.MediaProvider.next_location
Same as `_blocking_next_location` but without blocking (in theory). This method by default triggers a succeeded callback on a Twisted deferred, using `_blocking_next_location` result.

Parameters | uri | the URI representing the file or directory from where to move on (type: `elisa.core.media_uri.MediaUri` )
| root | root URI (type: `elisa.core.media_uri.MediaUri` )
Returns | (type: `twisted.internet.defer.Deferred` )

def read(self, media_file, size=-1):
overrides elisa.core.components.media_provider.MediaProvider.read
Same as `_blocking_seek` but without blocking (in theory). This method by default triggers a succeeded callback on a Twisted deferred, using `_blocking_seek` result.

Parameters | media_file | the file to read data from (type: `elisa.core.media_file.MediaFile` )
| size | how many data we should try to read (type: int (default: -1 == all) )
Returns | (type: `twisted.internet.defer.Deferred` )