Example #1
0
 def __init__(self, root, cmd_channel, ftproot, cwd, readonly=False):
     #_Base.__init__(self, root, cmd_channel)
     AbstractedFS.__init__(self, root, cmd_channel)
     self.cwd = cwd
     self.cwdftp = ""
     self.ftproot = ftproot
     self.readonly = readonly
 def __init__(self, root, cmd_channel, ftproot, cwd, readonly=False):
     #_Base.__init__(self, root, cmd_channel)
     AbstractedFS.__init__(self, root, cmd_channel)
     self.cwd = cwd
     self.cwdftp = ""
     self.ftproot = ftproot
     self.readonly = readonly
Example #3
0
	def open(self, filename, mode):
		from errno import EISDIR
		from os import strerror
		if filename is ShareRoot:
			raise IOError(EISDIR, strerror(EISDIR))
		else:
			return AbstractedFS.open(self, filename, mode)
Example #4
0
 def __init__(self, root, cmd_channel):
     AbstractedFS.__init__(self, root, cmd_channel)
     self.cwd = root
     self.type = cmd_channel.type
     self.s3_bucket = cmd_channel.s3_bucket
     self.aws_access_key = cmd_channel.aws_access_key
     self.aws_secret_key = cmd_channel.aws_secret_key
     self.seperator = cmd_channel.seperator
     self.thread_synchronize = cmd_channel.thread_synchronize
     self.key_sync_timeout = cmd_channel.key_sync_timeout
     if not self.cmd_channel.fs_obj:
         if self.type == "memory":
             self.fs_obj = MemoryFS()
         elif self.type == "s3":
             self.fs_obj = S3FS(bucket=self.bucket, prefix=self.prefix, aws_access_key=self.aws_access_key, aws_secret_key=self.aws_secret_key, separator=self.seperator, thread_synchronize=self.thread_synchronize, key_sync_timeout=self.key_sync_timeout)
         self.cmd_channel.fs_obj = self.fs_obj
     else:
         self.fs_obj = self.cmd_channel.fs_obj
Example #5
0
 def __init__(self, root, cmd_channel):
     AbstractedFS.__init__(self, root, cmd_channel)
     # initial cwd was set to "/" to emulate a chroot jail
     self.cwd = root
 def __init__(self, root, cmd_channel, list):
     AbstractedFS.__init__(self, root, cmd_channel)
     self.cwd = root
     self.list = list
Example #7
0
 def __init__(self, root, cmd_channel):
     AbstractedFS.__init__(self, root, cmd_channel)
     # initial cwd was set to "/" to emulate a chroot jail
     self.cwd = root
Example #8
0
	def chdir(self, path):
		if path is ShareRoot:
			self.cwd = "/"
			return
		else:
			return AbstractedFS.chdir(self, path)
Example #9
0
	def isfile(self, path):
		#pdb.set_trace()
		if path is ShareRoot:
			return False
		else:
			return AbstractedFS.isfile(self, path)
Example #10
0
	def realpath(self, path):
		if path in (ShareRoot, InvalidPath):
			return path
		else:
			return AbstractedFS.realpath(self, path)
Example #11
0
	def __init__(self):
		AbstractedFS.__init__(self)
Example #12
0
	def joinpath(self, head, tail):
		if head is ShareRoot:
			return self.shares[tail]
		else:
			return AbstractedFS.joinpath(self, head, tail)
Example #13
0
	def listdir(self, path):
		if path is ShareRoot:
			return self.shares.keys()
		else:
			return AbstractedFS.listdir(self, path)
Example #14
0
	def isdir(self, path):
		if path is ShareRoot:
			return True
		else:
			return AbstractedFS.isdir(self, path)
Example #15
0
 def __init__(self, root, cmd_channel, list):
     AbstractedFS.__init__(self, root, cmd_channel)
     self.cwd = root
     self.list = list