def _submit(self):
        '''submit a uservoice ticket. When we get here we should have:
           
           {'user_prompt_issue': 'I want to do the thing.', 
            'record_asciinema': '/tmp/helpme.93o__nt5.json',
            'record_environment': ((1,1),(2,2)...(N,N))}

           Required Client Variables
           self.api_key
           self.api_secret
           self.subdomain
           self.email

        '''

        # Step 0: Authenticate with uservoice API
        self.authenticate()
 
        title = "HelpMe UserVoice Ticket: %s" %(self.run_id)
        body = self.data['user_prompt_issue']

        # Step 1: Environment

        envars = self.data.get('record_environment')
        if envars not in [None, '', []]:
            body += '\n\nEnvironment:\n'
            for envar in envars:
                body += ' - %s: %s\n' %(envar[0], envar[1])

        # Step 2: Asciinema

        asciinema = self.data.get('record_asciinema')
        if asciinema not in [None, '']:
            url = upload_asciinema(asciinema)
               
            # If the upload is successful, add a link to it.

            if url is not None:
                body += "\n\nAsciinema Recording: %s" %url
 
        # Add other metadata about client

        body += "\ngenerated by HelpMe: https://vsoch.github.io/helpme/"

        # Submit the ticket!

        self.post_ticket(title, body)
def _submit ( self ) : self . authenticate ( ) title = "HelpMe UserVoice Ticket: %s" % ( self . run_id ) body = self . data [ 'user_prompt_issue' ] envars = self . data . get ( 'record_environment' ) if envars not in [ None , '' , [ ] ] : body += '\n\nEnvironment:\n' for envar in envars : body += ' - %s: %s\n' % ( envar [ 0 ] , envar [ 1 ] ) asciinema = self . data . get ( 'record_asciinema' ) if asciinema not in [ None , '' ] : url = upload_asciinema ( asciinema ) if url is not None : body += "\n\nAsciinema Recording: %s" % url body += "\ngenerated by HelpMe: https://vsoch.github.io/helpme/" self . post_ticket ( title , body )
submit a uservoice ticket. When we get here we should have:
           
           {'user_prompt_issue': 'I want to do the thing.', 
            'record_asciinema': '/tmp/helpme.93o__nt5.json',
            'record_environment': ((1,1),(2,2)...(N,N))}

           Required Client Variables
           self.api_key
           self.api_secret
           self.subdomain
           self.email