Exemplo n.º 1
0
 def post(self, item):
     dataset = get_dataset(current_app.commands.crawler, item.name)
     dataset_dir = path.abspath(path.dirname(dataset._path))
     if request.values['copy'] == u'true':
         op = copy
     else:
         op = move
     new_path = path.join(dataset_dir, request.values['name'])
     op(dataset._path, path.join(dataset_dir, request.values['name']))
     dataset = get_dataset(current_app.commands.crawler, request.values['name'])
     for key in dataset.keys():
         dataset[key]._path = new_path
     dataset.save()
Exemplo n.º 2
0
 def post(self, item):
     dataset = get_dataset(current_app.commands.crawler, item.name)
     dataset_dir = path.abspath(path.dirname(dataset._path))
     if request.values['copy'] == u'true':
         op = copy
     else:
         op = move
     new_path = path.join(dataset_dir, request.values['name'])
     op(dataset._path, path.join(dataset_dir, request.values['name']))
     dataset = get_dataset(current_app.commands.crawler,
                           request.values['name'])
     for key in dataset.keys():
         dataset[key]._path = new_path
     dataset.save()
Exemplo n.º 3
0
        def put(self, tree):
            '''create new dataset'''

            dataset = get_dataset(current_app.commands.crawler,
                                  request.values['name'])
            dataset.save()
            return ('tree/children.xml', {})
Exemplo n.º 4
0
        def put(self, tree):
            '''create new dataset'''

            dataset = get_dataset(current_app.commands.crawler,
                                  request.values['name'])
            dataset.save()
            return ('tree/children.xml', {})
Exemplo n.º 5
0
        def put(self, item):
            '''create new datasource'''
            dataset = get_dataset(current_app.commands.crawler, item.name)

            item.obj[request.values['name']] \
                = current_app.commands.crawler\
                  .datasources[request.values['type']](dataset._path)
            item.obj.save(dataset._path)
            return ('tree/children.xml', {})
Exemplo n.º 6
0
        def put(self, item):
            '''create new datasource'''
            dataset = get_dataset(current_app.commands.crawler,
                      item.name)

            item.obj[request.values['name']] \
                = current_app.commands.crawler\
                  .datasources[request.values['type']](dataset._path)
            item.obj.save(dataset._path)
            return ('tree/children.xml', {})