mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 03:49:42 +00:00
Bug 773826 - Move mkDirs implementation into base class, r=wlach
This commit is contained in:
parent
bf40f0efd9
commit
34a450a387
@ -65,15 +65,26 @@ class DeviceManager:
|
|||||||
failure: None
|
failure: None
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@abstractmethod
|
|
||||||
def mkDirs(self, filename):
|
def mkDirs(self, filename):
|
||||||
"""
|
"""
|
||||||
make directory structure on the device
|
make directory structure on the device
|
||||||
|
WARNING: does not create last part of the path
|
||||||
external function
|
external function
|
||||||
returns:
|
returns:
|
||||||
success: directory structure that we created
|
success: directory structure that we created
|
||||||
failure: None
|
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
|
@abstractmethod
|
||||||
def pushDir(self, localDir, remoteDir):
|
def pushDir(self, localDir, remoteDir):
|
||||||
|
@ -176,24 +176,6 @@ class DeviceManagerADB(DeviceManager):
|
|||||||
except:
|
except:
|
||||||
return None
|
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
|
# push localDir from host to remoteDir on the device
|
||||||
# external function
|
# external function
|
||||||
# returns:
|
# returns:
|
||||||
|
@ -362,23 +362,6 @@ class DeviceManagerSUT(DeviceManager):
|
|||||||
retVal = None
|
retVal = None
|
||||||
return retVal
|
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
|
# push localDir from host to remoteDir on the device
|
||||||
# external function
|
# external function
|
||||||
# returns:
|
# returns:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user