mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 773826 - Move mkDirs implementation into base class, r=wlach
This commit is contained in:
parent
2be6401141
commit
c88534c4d4
@ -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):
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user