def project_info_1(self, project_id):
        print('')
        print('When we created our project, it immediately ran the first step '
              'of the workflow: scraping an image from the website we passed '
              'in.')
        self.pause(2)
        print("Let's verify that this worked successfully by using "
              "Orchestra's API to check the project info.")
        self.pause(2)
        print('The API call looks like this:')
        print('')
        print('get_project_information(project_id)')
        print('')
        self.pause(2)
        input('Press enter when you are ready to make the API call and print '
              'out the JSON data received in response. ')

        project_info = get_project_information(project_id)
        print("Information received! Here's what we got:")
        print('')
        self.pause(2)
        pprint(project_info)
        self.pause(4)
        print('')
        print("Note that 'tasks.crawl.status' is 'Complete', and "
              "'tasks.crawl.latest_data.image' is set to an image URL scraped "
              "from our site. Paste the URL into a browser and you should see "
              "Joseph's smiling face!")
        self.pause(2)
        print("Also, check out 'tasks.rate'. That's the human step we'll need "
              "to do next. Observe that its status is 'Awaiting Processing' "
              "and that 'latest_data' is None because no work has been done "
              "yet.")
        self.pause(4)
    def project_info_1(self, project_id):
        print('')
        print('When we created our project, it immediately ran the first step '
              'of the workflow: scraping an image from the website we passed '
              'in.')
        self.pause(2)
        print("Let's verify that this worked successfully by using "
              "Orchestra's API to check the project info.")
        self.pause(2)
        print('The API call looks like this:')
        print('')
        print('get_project_information(project_id)')
        print('')
        self.pause(2)
        input('Press enter when you are ready to make the API call and print '
              'out the JSON data received in response. ')

        project_info = get_project_information(project_id)
        print("Information received! Here's what we got:")
        print('')
        self.pause(2)
        pprint(project_info)
        self.pause(4)
        print('')
        print("Note that 'tasks.crawl.status' is 'Complete', and "
              "'tasks.crawl.latest_data.image' is set to an image URL scraped "
              "from our site. Paste the URL into a browser and you should see "
              "Joseph's smiling face!")
        self.pause(2)
        print("Also, check out 'tasks.rate'. That's the human step we'll need "
              "to do next. Observe that its status is 'Awaiting Processing' "
              "and that 'latest_data' is None because no work has been done "
              "yet.")
        self.pause(4)
Exemplo n.º 3
0
 def project_info(self, project_id, verbose=True):
     p_info = get_project_information(project_id)
     if verbose:
         print("Information received! Here's what we got:")
         print('')
         pprint(p_info)
     return p_info
 def project_info(self, project_id, verbose=True):
     p_info = get_project_information(project_id)
     if verbose:
         print("Information received! Here's what we got:")
         print('')
         pprint(p_info)
     return p_info
    def get_rating_info(self, msg, project_id):
        input(msg)
        project_info = get_project_information(project_id)
        complete = project_info['tasks']['rate']['status'] == 'Complete'
        rating = (project_info['tasks']['rate']['latest_data'].get('rating')
                  if complete else None)
        print('')
        print("Information received! Here's what we got:")
        self.pause(2)
        print('')
        pprint(project_info)
        print('')
        self.pause(4)

        return complete, rating
    def get_rating_info(self, msg, project_id):
        input(msg)
        project_info = get_project_information(project_id)
        complete = project_info['tasks']['rate']['status'] == 'Complete'
        rating = (project_info['tasks']['rate']['latest_data'].get('rating')
                  if complete else None)
        print('')
        print("Information received! Here's what we got:")
        self.pause(2)
        print('')
        pprint(project_info)
        print('')
        self.pause(4)

        return complete, rating
Exemplo n.º 7
0
def project_details(request, project_id):
    info = get_project_information(project_id)
    project_data = _prettify_project_details(info['project'],
                                             info['tasks'],
                                             info['steps'])

    # opts, module_name, site_url, and has_permission are django admin related
    # variables that are used to help build the breadcrumbs and top bar content
    return render(request, 'orchestra/project_details.html', {
        'project': project_data['project'],
        'tasks': project_data['tasks'],
        'opts': Project._meta,
        'module_name': capfirst(force_text(Project._meta.verbose_name_plural)),
        'site_url': '/',
    })