Bug 773826 - Move mkDirs implementation into base class, r=wlach

This commit is contained in:
Mihnea Balaur 2012-07-17 10:35:41 -07:00
parent 2be6401141
commit c88534c4d4
3 changed files with 12 additions and 36 deletions

View File

@ -65,15 +65,26 @@ class DeviceManager:
failure: None
"""
@abstractmethod
def mkDirs(self, filename):
"""
make directory structure on the device
WARNING: does not create last part of the path
external function
returns:
success: directory structure that we created
failure: None
"""
parts = filename.split('/')
name = ""
for part in parts:
if (part == parts[-1]): break
if (part != ""):
name += '/' + part
if (not self.dirExists(name)):
if (self.mkDir(name) == None):
print "failed making directory: " + str(name)
return None
return name
@abstractmethod
def pushDir(self, localDir, remoteDir):

View File

@ -176,24 +176,6 @@ class DeviceManagerADB(DeviceManager):
except:
return None
# make directory structure on the device
# external function
# returns:
# success: directory structure that we created
# failure: None
def mkDirs(self, filename):
parts = filename.split('/')
name = ""
for part in parts:
if (part == parts[-1]): break
if (part != ""):
name += '/' + part
if (not self.dirExists(name)):
if (self.mkDir(name) == None):
print "failed making directory: " + str(name)
return None
return name
# push localDir from host to remoteDir on the device
# external function
# returns:

View File

@ -362,23 +362,6 @@ class DeviceManagerSUT(DeviceManager):
retVal = None
return retVal
# make directory structure on the device
# external function
# returns:
# success: directory structure that we created
# failure: None
def mkDirs(self, filename):
parts = filename.split('/')
name = ""
for part in parts:
if (part == parts[-1]): break
if (part != ""):
name += '/' + part
if (self.mkDir(name) == None):
print "failed making directory: " + str(name)
return None
return name
# push localDir from host to remoteDir on the device
# external function
# returns: