def session_started(self): """ run on connection initialisation """ self.user = self.server.user self.uuid = str(uuid.uuid4()) tracker.track_login('sftp', session_id=self.uuid, ip=self.client_ip, user=self.user) self.username = self.server.user.username self.cwd = "/home/%s" % self.username self.tree = DynamicTree(self) self.tree.name = '/' self.tree.add_path(self.cwd) exp_leaf = self.tree.add_path(os.path.join(self.cwd, 'experiments')) exp_leaf.update = exp_leaf.update_experiments