# -*- test-case-name: mv3d.test.test_asset -*- # Copyright (C) 2009-2012 Mortal Coil Games # See LICENSE for details. """ Interfaces for assets @author: mike """ from zope.interface import Interface class IAsset(Interface): def getID(): """ return the full id for this asset """ def setID(aid): """ set the full id for this asset """ def getName(): """ Returns my name """ def setName(name): """ Set my name. Names are non unique """ def getAuthor(): """ returns the author (str) """ def setAuthor(author): """ sets the author """ def getCopyright(): """ Returns the copyright notice """ def setCopyright(copyright): """ sets the copyright """ def getLicense(): """ Returns the license information (str) """ def setLicense(license): """ sets the license to l (str) """ def getDescription(): """ Returns the description (str) """ def setDescription(description): """ sets the description to d (str) """ def getRevisor(): """ returns the revisor (str) """ def setRevisor(revisor): """ sets the revisor to r (str) """ def getDate(): """ returns the date (Date) """ def setDate(date): """ sets the date to d (anything parsable by Date) """ def getComment(): """ returns the comment associated with this revision (str) """ def setComment(comment): """ Sets the comment associated with this revision to c (str) """ def haveAsset(): """ Returns true if was have downloaded or otherwise acquired an asset """ def acquireAsset(): """ This function will get the asset loaded by whatever means is appropriate. Normally, it'll return a deferred which will callback when the asset is finished downloading. If there is an instant error, it will return 0 right away. If the asset is already available, it'll return 1 right away. """ def getAsset(): """ This function will return the reference to the asset if it has been loaded. If not, it returns 0. """ def listDependencies(): """ Return a list of the aids that we depend on """ def acquireDependencies(**kw): """ This function will make sure that all the dependencies of this asset are loaded... It probably returns a deferred """ def addDependency(depID): """ Add the aid of an asset that needs to be loaded before we can be loaded. """ def setDependencies(dependencies): """ Add the aid of an asset that needs to be loaded before we can be loaded. """ def remDependency(depID): """ Remove d from the list of asset ids that we depend on return 0 if d isn't a current dependency. """ def getChecksum(): """ Get the checksum for this asset """ def setChecksum(checksum): """ Get the checksum for this asset """ def refreshChecksum(): """ Causes the checksum to be reloaded for this asset """ def getClassGenerator(): """ Returns a class generator for this asset class """ class IUploader(Interface): """ Defines an interface for a class that can handle uploading asset data to a server for distribution. """ def configure(configFile, section): """ Configures the uploader from the supplied ConfigParser-like object in the given section. """ def upload(localFile, remoteFile): """ Uploads the asset data to the server. Returns a deferred. """