Example #1
0
 def show_import_profile_uri(self):
     dialog = interface.InputDialog()
     dialog.set_title('%s - Import Profile URI' % APP_NAME_FORMATED)
     dialog.set_icon(utils.get_logo())
     dialog.set_message('Import Profile URI')
     dialog.set_message_secondary('Enter profile URI to import...')
     dialog.set_input_label('Profile URI:')
     dialog.set_input_width(32)
     response = dialog.run()
     if response:
         try:
             profile.import_uri(response)
         except Exception as exception:
             self.show_import_profile_error(exception)
         self.update_menu()
     dialog.destroy()
Example #2
0
 def show_import_profile_uri(self):
     dialog = interface.InputDialog()
     dialog.set_title('%s - Import Profile URI' % APP_NAME_FORMATED)
     dialog.set_icon(utils.get_logo())
     dialog.set_message('Import Profile URI')
     dialog.set_message_secondary('Enter profile URI to import...')
     dialog.set_input_label('Profile URI:')
     dialog.set_input_width(32)
     response = dialog.run()
     if response:
         try:
             profile.import_uri(response)
         except Exception as exception:
             self.show_import_profile_error(exception)
         self.update_menu()
     dialog.destroy()
Example #3
0
    def do_import(self):
        profile_path = self.data.get('profile_path')
        profile_uri = self.data.get('profile_uri')

        if profile_path:
            profile.import_file(profile_path)
        elif profile_uri:
            try:
                profile.import_uri(profile_uri)
            except httplib.HTTPException:
                self.send_text_response('Unable to retrieve profile or ' +
                    'profile path does not exist', 500)
        else:
            raise ValueError('Must have profile_path or profile_uri')

        self.send_response(200)
Example #4
0
    def do_import(self):
        profile_path = self.data.get('profile_path')
        profile_uri = self.data.get('profile_uri')

        if profile_path:
            profile.import_file(profile_path)
        elif profile_uri:
            try:
                profile.import_uri(profile_uri)
            except httplib.HTTPException:
                self.send_text_response(
                    'Unable to retrieve profile or ' +
                    'profile path does not exist', 500)
        else:
            raise ValueError('Must have profile_path or profile_uri')

        self.send_response(200)