Beispiel #1
0
def move_action(args: argparse.Namespace) -> int:
    try:
        r = metadata.move_node(args.child, args.parent)
        sync.insert_node(r)
    except RequestError as e:
        print(e)
        return 1
Beispiel #2
0
def move_action(args: argparse.Namespace) -> int:
    try:
        r = metadata.move_node(args.child, args.parent)
        sync.insert_node(r)
    except RequestError as e:
        print(e)
        return 1
Beispiel #3
0
 def _move(id, old_folder, new_folder):
     try:
         r = metadata.move_node(id, old_folder, new_folder)
     except RequestError as e:
         FuseOSError.convert(e)
     else:
         sync.insert_node(r)
Beispiel #4
0
 def _move(id, old_folder, new_folder):
     try:
         r = metadata.move_node(id, old_folder, new_folder)
     except RequestError as e:
         FuseOSError.convert(e)
     else:
         sync.insert_node(r)
Beispiel #5
0
 def test_move_node(self):
     f_id = self.create_random_dir()
     node = content.create_file(gen_rand_nm())
     old_parent = node['parents'][0]
     node = metadata.move_node(node['id'], old_parent, f_id)
     self.assertEqual(node['parents'][0], f_id)
     trash.move_to_trash(f_id)
     trash.move_to_trash(node['id'])
Beispiel #6
0
 def test_move_node(self):
     f_id = self.create_random_dir()
     node = content.create_file(gen_rand_nm())
     old_parent = node['parents'][0]
     node = metadata.move_node(node['id'], old_parent, f_id)
     self.assertEqual(node['parents'][0], f_id)
     trash.move_to_trash(f_id)
     trash.move_to_trash(node['id'])
Beispiel #7
0
def move_action(args: argparse.Namespace) -> int:
    node = query.get_node(args.child)
    if not node:
        return INVALID_ARG_RETVAL
    if len(node.parents) > 1:
        logger.error('Cannot move node with multiple parents.')
        return ERROR_RETVAL

    try:
        r = metadata.move_node(args.child, node.parents[0].id, args.parent)
        sync.insert_node(r)
    except RequestError as e:
        print(e)
        return ERROR_RETVAL
Beispiel #8
0
def move_action(args: argparse.Namespace) -> int:
    node = query.get_node(args.child)
    if not node:
        return INVALID_ARG_RETVAL
    if len(node.parents) > 1:
        logger.error('Cannot move node with multiple parents.')
        return ERROR_RETVAL

    try:
        r = metadata.move_node(args.child, node.parents[0].id, args.parent)
        sync.insert_node(r)
    except RequestError as e:
        print(e)
        return ERROR_RETVAL