Exemplo n.º 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
Exemplo n.º 2
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
Exemplo n.º 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)
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 6
0
 def __init__(self, root, cmd_channel, list):
     AbstractedFS.__init__(self, root, cmd_channel)
     self.cwd = root
     self.list = list
Exemplo n.º 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
Exemplo n.º 8
0
	def chdir(self, path):
		if path is ShareRoot:
			self.cwd = "/"
			return
		else:
			return AbstractedFS.chdir(self, path)
Exemplo n.º 9
0
	def isfile(self, path):
		#pdb.set_trace()
		if path is ShareRoot:
			return False
		else:
			return AbstractedFS.isfile(self, path)
Exemplo n.º 10
0
	def realpath(self, path):
		if path in (ShareRoot, InvalidPath):
			return path
		else:
			return AbstractedFS.realpath(self, path)
Exemplo n.º 11
0
	def __init__(self):
		AbstractedFS.__init__(self)
Exemplo n.º 12
0
	def joinpath(self, head, tail):
		if head is ShareRoot:
			return self.shares[tail]
		else:
			return AbstractedFS.joinpath(self, head, tail)
Exemplo n.º 13
0
	def listdir(self, path):
		if path is ShareRoot:
			return self.shares.keys()
		else:
			return AbstractedFS.listdir(self, path)
Exemplo n.º 14
0
	def isdir(self, path):
		if path is ShareRoot:
			return True
		else:
			return AbstractedFS.isdir(self, path)
Exemplo n.º 15
0
 def __init__(self, root, cmd_channel, list):
     AbstractedFS.__init__(self, root, cmd_channel)
     self.cwd = root
     self.list = list