Logo Search packages:      
Sourcecode: mago version File versions  Download package

def mago::application::gnome::Seahorse::new_pgp_key (   self,
  full_name,
  email,
  comment,
  passphrase 
)

It creates a new PGP key with the default settings.

TODO: Allow advanced options
TODO: Check the list afterwards for the newly created key

@type full_name: string 
@param full_name: Full name to type for the PGP key

@type email: string 
@param email: Email to type for the PGP key

@type comment: string 
@param comment: Comment to type for the PGP key

@type passphrase: string 
@param passphrase: Passphrase to type for the PGP key

Definition at line 97 of file gnome.py.

00097                                                                 :
        """
        It creates a new PGP key with the default settings.

        TODO: Allow advanced options
        TODO: Check the list afterwards for the newly created key

        @type full_name: string 
        @param full_name: Full name to type for the PGP key

        @type email: string 
        @param email: Email to type for the PGP key

        @type comment: string 
        @param comment: Comment to type for the PGP key

        @type passphrase: string 
        @param passphrase: Passphrase to type for the PGP key
        """
        
        self.new_key(self.TYPE_PGP)

        try:
            ldtp.waittillguiexist(self.NEWPGP_DLG)
            dlg_new_pgp = ooldtp.context(self.NEWPGP_DLG)
        except ldtp.LdtpExecutionError:
            raise ldtp.LdtpExecutionError, "The new key dialog was not found."

        try:
            txt_field = dlg_new_pgp.getchild(self.DLG_NEWPGP_FULLNAME)
        except ldtp.LdtpExecutionError:
            raise ldtp.LdtpExecutionError, "The " + txt_field + " text field was not found."
        try:
            txt_field.settextvalue(full_name)
        except ldtp.LdtpExecutionError:
            raise ldtp.LdtpExecutionError, "There was an error when writing the text."

        try:
            txt_field = dlg_new_pgp.getchild(self.DLG_NEWPGP_EMAIL)
        except ldtp.LdtpExecutionError:
            raise ldtp.LdtpExecutionError, "The " + txt_field + " text field was not found."
        try:
            txt_field.settextvalue(email)
        except ldtp.LdtpExecutionError:
            raise ldtp.LdtpExecutionError, "There was a problem when writing the text."
   
        try:
            txt_field = dlg_new_pgp.getchild(self.DLG_NEWPGP_COMMENT)
        except ldtp.LdtpExecutionError:
            raise ldtp.LdtpExecutionError, "The " + txt_field + " text field was not found."
        try:
            txt_field.settextvalue(comment)
        except ldtp.LdtpExecutionError:
            raise ldtp.LdtpExecutionError, "There was a problem when writing the text."

        try:
            btn_create = dlg_new_pgp.getchild(self.BTN_NEWPGP_CREATE)
        except ldtp.LdtpExecutionError:
            raise ldtp.LdtpExecutionError, "The create button at the new PGP key dialog was not found."

        try:
            btn_create.click() 
        except ldtp.LdtpExecutionError:
            raise ldtp.LdtpExecutionError, "There was a problem when clicking the create button."
       
        try:
            ldtp.waittillguiexist(self.DLG_NEWKEY_PASS)
            dlg_new_pgp_pass = ooldtp.context(self.DLG_NEWKEY_PASS)
        except ldtp.LdtpExecutionError:
            raise ldtp.LdtpExecutionError, "The new pgp key passphrase dialog was not found."

        try:
            ldtp.enterstring(passphrase)
            ldtp.enterstring("<tab>")
            ldtp.enterstring(passphrase)
        except ldtp.LdtpExecutionError:
            raise ldtp.LdtpExecutionError, "Error entering passphrase."
 
        try:
            btn_pass_ok = dlg_new_pgp_pass.getchild(self.BTN_PASS_OK)
        except ldtp.LdtpExecutionError:
            raise ldtp.LdtpExecutionError, "The OK button at the new PGP key passphrase dialog was not found."

        try:
            btn_pass_ok.click() 
        except ldtp.LdtpExecutionError:
            raise ldtp.LdtpExecutionError, "There was a problem when clicking the OK button."
 
        try:
            ldtp.waittillguiexist(self.DLG_GENERATING_KEY)
            while ldtp.guiexist(self.DLG_GENERATING_KEY) == 1:
                ldtp.wait(1)
        except ldtp.LdtpExecutionError:
            raise ldtp.LdtpExecutionError, "The new pgp generating key dialog was not found."

        # Add key name to generated key list, so we know to delete it later.
        self.generated_keys.append('  '.join([full_name, email, "'"+comment+"'"]))

    def new_ssh_key(self, description, passphrase, set_up = False, computer = '', login = ''):


Generated by  Doxygen 1.6.0   Back to index