Пример #1
0
	def _sync_dirs( self ) :
		if self._synced( 'dirs.timestamp' ) :
			return

		self.dirs = {}
		for p in self.con.get_account()[1] :
			name = sw2fs(p['name'])
			self.dirs[name] = Dir( self.con , 0644 )

		for path , dir in self.dirs.items() :
			parent_path , name = os.path.split(path)
			parent = self.dirs[parent_path]
			if name != '' :
				parent.set_child( name , dir )
				dir.set_parent( parent )
Пример #2
0
    def _sync_dirs(self):
        if self._synced('dirs.timestamp'):
            return

        self.dirs = {}
        for p in self.con.get_account()[1]:
            name = sw2fs(p['name'])
            d = Dir(self.con, 0755)
            for c in self.con.get_container(p['name'])[1]:
                o = self.con.get_object(p['name'], c['name'])
                d.set_child(c['name'], File(0644, o[1], o[0]['last-modified']))
            self.dirs[name] = d

        for path, dir in self.dirs.items():
            parent_path, name = os.path.split(path)
            parent = self.dirs[parent_path]
            if name != '':
                parent.set_child(name, dir)
                dir.set_parent(parent)
Пример #3
0
	def _sync_dirs( self ) :
		if self._synced( 'dirs.timestamp' ) :
			return

		self.dirs = {}
		for p in self.con.get_account()[1] :
			name = sw2fs(p['name'])
			d = Dir( self.con , 0755 )
			for c in self.con.get_container(p['name'])[1] :
				o = self.con.get_object(p['name'],c['name'])
				d.set_child( c['name'] , File(0644,o[1],o[0]['last-modified']) )
			self.dirs[name] = d

		for path , dir in self.dirs.items() :
			parent_path , name = os.path.split(path)
			parent = self.dirs[parent_path]
			if name != '' :
				parent.set_child( name , dir )
				dir.set_parent( parent )