diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-02-14 12:35:47 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-02-14 12:35:47 -0600 |
commit | 3bcf39c02a56b4527de4a8d11fe14ae72dd9d143 (patch) | |
tree | aeb893d5b4e03cc30348ffb70b3846961f378d60 /app_templates/tdeioslave | |
parent | 300fd86e29a83cab4ac59056a13060a6ea1b6613 (diff) | |
download | pytdeextensions-3bcf39c02a56b4527de4a8d11fe14ae72dd9d143.tar.gz pytdeextensions-3bcf39c02a56b4527de4a8d11fe14ae72dd9d143.zip |
Rename KIO
Diffstat (limited to 'app_templates/tdeioslave')
-rwxr-xr-x | app_templates/tdeioslave/src/tdeioslave.py | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/app_templates/tdeioslave/src/tdeioslave.py b/app_templates/tdeioslave/src/tdeioslave.py index edc874f..0dd8b8d 100755 --- a/app_templates/tdeioslave/src/tdeioslave.py +++ b/app_templates/tdeioslave/src/tdeioslave.py @@ -17,7 +17,7 @@ # Import the required Qt and KDE modules. from qt import * -from kio import * +from tdeio import * from tdecore import * import os, time @@ -28,8 +28,8 @@ DEBUG = 1 # Define a class which will be used to create IOSlave instances. ############################################################################ -class SlaveClass(KIO.SlaveBase): - """SlaveClass(KIO.SlaveBase) +class SlaveClass(TDEIO.SlaveBase): + """SlaveClass(TDEIO.SlaveBase) See tdelibs/tdeio/tdeio/slavebase.h for virtual functions to override. """ @@ -37,7 +37,7 @@ class SlaveClass(KIO.SlaveBase): ######################################################################## def __init__(self, pool, app): # We must call the initialisation method of the base class. - KIO.SlaveBase.__init__(self, "tdeioslave", pool, app) + TDEIO.SlaveBase.__init__(self, "tdeioslave", pool, app) # Attach the DCOP client object associated with this IOSlave to the # DCOP server. @@ -58,7 +58,7 @@ class SlaveClass(KIO.SlaveBase): pass ######################################################################## - # KIO.SlaveBase method + # TDEIO.SlaveBase method def setHost(self, host, port, user, passwd): self.debug( "setHost: %s %s %s %s" % ( @@ -71,23 +71,23 @@ class SlaveClass(KIO.SlaveBase): # a URL. if unicode(host) != u"": self.closeConnection() - self.error(KIO.ERR_MALFORMED_URL, host) + self.error(TDEIO.ERR_MALFORMED_URL, host) return ######################################################################## - # KIO.SlaveBase method + # TDEIO.SlaveBase method def openConnection(self): # Don't call self.finished() in this method. self.debug("openConnection") ######################################################################## - # KIO.SlaveBase method + # TDEIO.SlaveBase method def closeConnection(self): # Don't call self.finished() in this method. self.debug("closeConnection") ######################################################################## - # KIO.SlaveBase method + # TDEIO.SlaveBase method def get(self, url): path = str(url.path()) self.debug("get(): %s" % path) @@ -95,11 +95,11 @@ class SlaveClass(KIO.SlaveBase): item = self.contents.resolve(path) if item is None: - self.error(KIO.ERR_DOES_NOT_EXIST, path) + self.error(TDEIO.ERR_DOES_NOT_EXIST, path) return if item.isDir(): - self.error(KIO.ERR_IS_DIRECTORY, path) + self.error(TDEIO.ERR_IS_DIRECTORY, path) self.totalSize(len(item.getData())) self.data(QByteArray(item.getData())) @@ -110,7 +110,7 @@ class SlaveClass(KIO.SlaveBase): self.finished() ######################################################################## - # KIO.SlaveBase method + # TDEIO.SlaveBase method def put(self, url, permissions, overwrite, resume): self.debug("put") self.openConnection() @@ -121,12 +121,12 @@ class SlaveClass(KIO.SlaveBase): parent_dir = self.contents.resolveParent(path) if parent_dir is None: parent_path = '/'.join(parts[:-1]) - self.error(KIO.ERR_DOES_NOT_EXIST, parent_path) + self.error(TDEIO.ERR_DOES_NOT_EXIST, parent_path) return if parent_dir.contains(filename): if not overwrite: - self.error(KIO.ERR_COULD_NOT_WRITE, parent_path) + self.error(TDEIO.ERR_COULD_NOT_WRITE, parent_path) return else: parent_dir.unlink(filename) @@ -153,7 +153,7 @@ class SlaveClass(KIO.SlaveBase): self.finished() ######################################################################## - # KIO.SlaveBase method + # TDEIO.SlaveBase method def stat(self, url): self.debug("stat: %s" % url.url(0,0)) self.openConnection() @@ -163,14 +163,14 @@ class SlaveClass(KIO.SlaveBase): # Return info the for the root. item = self.contents.resolve(str(url.path())) if item is None: - self.error(KIO.ERR_DOES_NOT_EXIST, str(url.path())) + self.error(TDEIO.ERR_DOES_NOT_EXIST, str(url.path())) return self.statEntry(item.getStatEntry()) self.finished() ######################################################################## - # KIO.SlaveBase method + # TDEIO.SlaveBase method def mimetype(self, url): self.debug("mimetype: %s" % unicode(url)) self.openConnection() @@ -178,7 +178,7 @@ class SlaveClass(KIO.SlaveBase): path = str(url.path()) item = self.contents.resolve(path) if item is None: - self.error(KIO.ERR_DOES_NOT_EXIST, path) + self.error(TDEIO.ERR_DOES_NOT_EXIST, path) return self.mimeType(item.getMimetype()) @@ -186,7 +186,7 @@ class SlaveClass(KIO.SlaveBase): self.finished() ######################################################################## - # KIO.SlaveBase method + # TDEIO.SlaveBase method def listDir(self, url): # The "url" argument is a tdecore.KURL object. self.debug("listDir: %s" % str(url.prettyURL(0))) @@ -195,11 +195,11 @@ class SlaveClass(KIO.SlaveBase): path = str(url.path()) dir = self.contents.resolve(path) if dir is None: - self.error(KIO.ERR_DOES_NOT_EXIST, path) + self.error(TDEIO.ERR_DOES_NOT_EXIST, path) return if not dir.isDir(): - self.error(KIO.ERR_IS_FILE, path) + self.error(TDEIO.ERR_IS_FILE, path) return for entry in dir.listDir(): @@ -209,7 +209,7 @@ class SlaveClass(KIO.SlaveBase): self.finished() ######################################################################## - # KIO.SlaveBase method + # TDEIO.SlaveBase method def mkdir(self, url, permissions): self.debug("mkdir") self.openConnection() @@ -217,18 +217,18 @@ class SlaveClass(KIO.SlaveBase): parent_path = str(url.path()) parent_dir = self.contents.resolveParent(parent_path) if parent_dir is None: - self.error(KIO.ERR_DOES_NOT_EXIST, parent_path) + self.error(TDEIO.ERR_DOES_NOT_EXIST, parent_path) return new_dir_obj = parent_dir.mkdir(parent_path.split('/')[-1]) if new_dir_obj is None: - self.error(KIO.ERR_COULD_NOT_MKDIR, parent_path) + self.error(TDEIO.ERR_COULD_NOT_MKDIR, parent_path) return self.finished() ######################################################################## - # KIO.SlaveBase method + # TDEIO.SlaveBase method def rename(self, src, dest, overwrite): self.debug("rename: %s %s" % (src.path(), dest.path())) self.openConnection() @@ -236,7 +236,7 @@ class SlaveClass(KIO.SlaveBase): src_path = str(src.path()) src_obj = self.contents.resolve(src_path) if src_obj is None: - self.error(KIO.ERR_DOES_NOT_EXIST, src_path) + self.error(TDEIO.ERR_DOES_NOT_EXIST, src_path) return # See if the destination path already exists. @@ -249,7 +249,7 @@ class SlaveClass(KIO.SlaveBase): if not overwrite: # Can't overwrite. not bad. - self.error(KIO.ERR_CANNOT_RENAME, dest_path) + self.error(TDEIO.ERR_CANNOT_RENAME, dest_path) return else: # Over write, just remove the object. @@ -257,7 +257,7 @@ class SlaveClass(KIO.SlaveBase): dest_dir = self.contents.resolveParent(dest_path) if dest_dir is None: - self.error(KIO.ERR_DOES_NOT_EXIST, dest_path) + self.error(TDEIO.ERR_DOES_NOT_EXIST, dest_path) return src_obj.getParent().unlink(src_obj) @@ -280,7 +280,7 @@ class SlaveClass(KIO.SlaveBase): # self.finished() ######################################################################## - # KIO.SlaveBase method + # TDEIO.SlaveBase method def copy(self, src, dest, permissions, overwrite): self.debug("copy") self.openConnection() @@ -288,7 +288,7 @@ class SlaveClass(KIO.SlaveBase): src_path = str(src.path()) src_obj = self.contents.resolve(src_path) if src_obj is None: - self.error(KIO.ERR_DOES_NOT_EXIST, src_path) + self.error(TDEIO.ERR_DOES_NOT_EXIST, src_path) return # See if the destination path already exists. @@ -301,7 +301,7 @@ class SlaveClass(KIO.SlaveBase): if not overwrite: # Can't overwrite. not bad. - self.error(KIO.ERR_COULD_NOT_WRITE, dest_path) + self.error(TDEIO.ERR_COULD_NOT_WRITE, dest_path) return else: # Over write, just remove the object. @@ -309,7 +309,7 @@ class SlaveClass(KIO.SlaveBase): dest_dir = self.contents.resolveParent(dest_path) if dest_dir is None: - self.error(KIO.ERR_DOES_NOT_EXIST, dest_path) + self.error(TDEIO.ERR_DOES_NOT_EXIST, dest_path) return new_obj = src_obj.copy() @@ -319,7 +319,7 @@ class SlaveClass(KIO.SlaveBase): self.finished() ######################################################################## - # KIO.SlaveBase method + # TDEIO.SlaveBase method def del_(self, url, isfile): self.debug("del_") self.openConnection() @@ -327,7 +327,7 @@ class SlaveClass(KIO.SlaveBase): path = str(url.path()) item = self.contents.resolve(path) if item is None: - self.error(KIO.ERR_DOES_NOT_EXIST, path) + self.error(TDEIO.ERR_DOES_NOT_EXIST, path) return item.getParent().unlink(item.getName()) @@ -335,22 +335,22 @@ class SlaveClass(KIO.SlaveBase): self.finished() ######################################################################## - # KIO.SlaveBase method + # TDEIO.SlaveBase method def disconnectSlave(self): self.debug("disconnectSlave") return ######################################################################## - # KIO.SlaveBase method + # TDEIO.SlaveBase method def dispatchLoop(self): self.debug("dispatchLoop") - KIO.SlaveBase.dispatchLoop(self) + TDEIO.SlaveBase.dispatchLoop(self) ######################################################################## - # KIO.SlaveBase method + # TDEIO.SlaveBase method def error(self,errid,text): self.debug("error: %i, %s" % (errid,text) ) - KIO.SlaveBase.error(self,errid,text) + TDEIO.SlaveBase.error(self,errid,text) ############################################################################ def debug(self,msg): @@ -429,40 +429,40 @@ class RAMDir(object): length = 0 entry = [] - atom = KIO.UDSAtom() - atom.m_uds = KIO.UDS_NAME + atom = TDEIO.UDSAtom() + atom.m_uds = TDEIO.UDS_NAME atom.m_str = self.name #debug("name: %s" % name) entry.append(atom) - atom = KIO.UDSAtom() - atom.m_uds = KIO.UDS_SIZE + atom = TDEIO.UDSAtom() + atom.m_uds = TDEIO.UDS_SIZE atom.m_long = length #debug("length: %i" % length) entry.append(atom) - atom = KIO.UDSAtom() - atom.m_uds = KIO.UDS_MODIFICATION_TIME + atom = TDEIO.UDSAtom() + atom.m_uds = TDEIO.UDS_MODIFICATION_TIME # Number of seconds since the epoch. atom.m_long = int(time.time()) entry.append(atom) - atom = KIO.UDSAtom() - atom.m_uds = KIO.UDS_ACCESS + atom = TDEIO.UDSAtom() + atom.m_uds = TDEIO.UDS_ACCESS # The usual octal permission information (rw-r--r-- in this case). atom.m_long = 0644 entry.append(atom) # If the stat method is implemented then entries _must_ include # the UDE_FILE_TYPE atom or the whole system may not work at all. - atom = KIO.UDSAtom() - atom.m_uds = KIO.UDS_FILE_TYPE + atom = TDEIO.UDSAtom() + atom.m_uds = TDEIO.UDS_FILE_TYPE #atom.m_long = os.path.stat.S_IFREG atom.m_long = os.path.stat.S_IFDIR entry.append(atom) - atom = KIO.UDSAtom() - atom.m_uds = KIO.UDS_MIME_TYPE + atom = TDEIO.UDSAtom() + atom.m_uds = TDEIO.UDS_MIME_TYPE atom.m_str = self.getMimetype() entry.append(atom) @@ -558,8 +558,8 @@ class RAMFile(object): length = 0 entry = [] - atom = KIO.UDSAtom() - atom.m_uds = KIO.UDS_NAME + atom = TDEIO.UDSAtom() + atom.m_uds = TDEIO.UDS_NAME atom.m_str = self.name #debug("name: %s" % name) entry.append(atom) @@ -568,33 +568,33 @@ class RAMFile(object): if self.data is not None: length = len(self.data) - atom = KIO.UDSAtom() - atom.m_uds = KIO.UDS_SIZE + atom = TDEIO.UDSAtom() + atom.m_uds = TDEIO.UDS_SIZE atom.m_long = length #debug("length: %i" % length) entry.append(atom) - atom = KIO.UDSAtom() - atom.m_uds = KIO.UDS_MODIFICATION_TIME + atom = TDEIO.UDSAtom() + atom.m_uds = TDEIO.UDS_MODIFICATION_TIME # Number of seconds since the epoch. atom.m_long = int(time.time()) entry.append(atom) - atom = KIO.UDSAtom() - atom.m_uds = KIO.UDS_ACCESS + atom = TDEIO.UDSAtom() + atom.m_uds = TDEIO.UDS_ACCESS # The usual octal permission information (rw-r--r-- in this case). atom.m_long = 0644 entry.append(atom) # If the stat method is implemented then entries _must_ include # the UDE_FILE_TYPE atom or the whole system may not work at all. - atom = KIO.UDSAtom() - atom.m_uds = KIO.UDS_FILE_TYPE + atom = TDEIO.UDSAtom() + atom.m_uds = TDEIO.UDS_FILE_TYPE atom.m_long = os.path.stat.S_IFREG entry.append(atom) - atom = KIO.UDSAtom() - atom.m_uds = KIO.UDS_MIME_TYPE + atom = TDEIO.UDSAtom() + atom.m_uds = TDEIO.UDS_MIME_TYPE atom.m_str = self.getMimetype() entry.append(atom) |