Ejemplo n.º 1
0
 def magic_folder_invite(self, name, nickname):
     yield self.await_ready()
     admin_dircap = self.get_admin_dircap(name)
     if not admin_dircap:
         raise TahoeError(
             'No admin dircap found for folder "{}"'.format(name))
     created = yield self.mkdir(admin_dircap, nickname)
     code = '{}+{}'.format(self.get_collective_dircap(name), created)
     return code
Ejemplo n.º 2
0
 def magic_folder_invite(self, name, nickname):
     yield self.await_ready()
     admin_dircap = self.get_admin_dircap(name)
     if not admin_dircap:
         raise TahoeError(
             'No admin dircap found for folder "{}"; you do not have the '
             "authority to create invites for this folder.".format(name))
     created = yield self.mkdir(admin_dircap, nickname)
     code = "{}+{}".format(self.get_collective_dircap(name), created)
     return code
Ejemplo n.º 3
0
 def restore_magic_folder(self, folder_name, dest):
     data = self.remote_magic_folders[folder_name]
     admin_dircap = data.get('admin_dircap')
     collective_dircap = data.get('collective_dircap')
     upload_dircap = data.get('upload_dircap')
     if not collective_dircap or not upload_dircap:
         raise TahoeError(
             'The capabilities needed to restore the folder "{}" could '
             'not be found. This probably means that the folder was '
             'never completely uploaded to begin with -- or worse, '
             'that your rootcap was corrupted somehow after the fact.\n'
             '\nYou will need to remove this folder and upload it '
             'again.'.format(folder_name))
     yield self.create_magic_folder(
         os.path.join(dest, folder_name),
         "{}+{}".format(collective_dircap, upload_dircap), admin_dircap)