Beispiel #1
0
    def post(self):
        email = urllib.unquote(self.request.get('email'))
        if verify_user(email, self.response) == False:
            return

        keys = self.request.get_all('task_key')
        if len(keys) == 0:
            self.response.out.write(inspector.template.error('You should select at least one item.'))
            return

        if datastore.delete_tasks(keys) == True:
            self.redirect('/inspectors')
        else:
            self.response.out.write(inspector.template.error('Datastore delete error'))
Beispiel #2
0
    def get(self):
        email = urllib.unquote(self.request.get('email'))
        if verify_user(email, self.response) == False:
            return

        template_values = {
            'email': email,
            'url': self.request.get('url'),
            'xpath': self.request.get('xpath')
        }
        for k, v in template_values.items():
            template_values[k] = urllib.quote(v)
        template_values['user'] = users.get_current_user()

        self.response.out.write(inspector.template.info('submit.html', template_values))
Beispiel #3
0
    def get(self):
        email = urllib.unquote(self.request.get('email'))
        if verify_user(email, self.response) == False:
            return

        template_values = {
            'email': email,
            'url': self.request.get('url'),
            'xpath': self.request.get('xpath')
        }
        for k, v in template_values.items():
            template_values[k] = urllib.quote(v)
        template_values['user'] = users.get_current_user()

        self.response.out.write(
            inspector.template.info('submit.html', template_values))
Beispiel #4
0
    def post(self):
        email = urllib.unquote(self.request.get('email'))
        if verify_user(email, self.response) == False:
            return

        url = urllib.unquote(self.request.get('url'))
        xpath = urllib.unquote(self.request.get('xpath'))
        status, html = inspector_job.get_html(url, xpath)
        if status == False:
            self.response.out.write(inspector.template.error(html))
            return

        rval = datastore.add_task(email, url, xpath, html)
        if rval == True:
            self.redirect('/')
        else:
            self.response.out.write(inspector.template.error(rval))
Beispiel #5
0
    def post(self):
        email = urllib.unquote(self.request.get('email'))
        if verify_user(email, self.response) == False:
            return

        url = urllib.unquote(self.request.get('url'))
        xpath = urllib.unquote(self.request.get('xpath'))
        status, html = inspector_job.get_html(url, xpath)
        if status == False:
            self.response.out.write(inspector.template.error(html))
            return

        rval = datastore.add_task(email, url, xpath, html)
        if rval == True:
            self.redirect('/')
        else:
            self.response.out.write(inspector.template.error(rval))
Beispiel #6
0
    def post(self):
        email = urllib.unquote(self.request.get('email'))
        if verify_user(email, self.response) == False:
            return

        keys = self.request.get_all('task_key')
        if len(keys) == 0:
            self.response.out.write(
                inspector.template.error(
                    'You should select at least one item.'))
            return

        if datastore.delete_tasks(keys) == True:
            self.redirect('/inspectors')
        else:
            self.response.out.write(
                inspector.template.error('Datastore delete error'))