solvebio/cli/credentials.py
def save(self, path):
        """Dump the class data in the format of a .netrc file."""
        rep = ""
        for host in self.hosts.keys():
            attrs = self.hosts[host]
            rep = rep + "machine " + host + "\n\tlogin " \
                + six.text_type(attrs[0]) + "\n"
            if attrs[1]:
                rep = rep + "account " + six.text_type(attrs[1])
            rep = rep + "\tpassword " + six.text_type(attrs[2]) + "\n"
        for macro in self.macros.keys():
            rep = rep + "macdef " + macro + "\n"
            for line in self.macros[macro]:
                rep = rep + line
            rep = rep + "\n"

        f = open(path, 'w')
        f.write(rep)
        f.close()
def save(self, path):
        """Dump the class data in the format of a .netrc file."""
        rep = ""
        for host in self.hosts.keys():
            attrs = self.hosts[host]
            rep = rep + "machine " + host + "\n\tlogin " \
                + six.text_type(attrs[0]) + "\n"
            if attrs[1]:
                rep = rep + "account " + six.text_type(attrs[1])
            rep = rep + "\tpassword " + six.text_type(attrs[2]) + "\n"
        for macro in self.macros.keys():
            rep = rep + "macdef " + macro + "\n"
            for line in self.macros[macro]:
                rep = rep + line
            rep = rep + "\n"

        f = open(path, 'w')
        f.write(rep)
        f.close()
def save ( self , path ) : rep = "" for host in self . hosts . keys ( ) : attrs = self . hosts [ host ] rep = rep + "machine " + host + "\n\tlogin " + six . text_type ( attrs [ 0 ] ) + "\n" if attrs [ 1 ] : rep = rep + "account " + six . text_type ( attrs [ 1 ] ) rep = rep + "\tpassword " + six . text_type ( attrs [ 2 ] ) + "\n" for macro in self . macros . keys ( ) : rep = rep + "macdef " + macro + "\n" for line in self . macros [ macro ] : rep = rep + line rep = rep + "\n" f = open ( path , 'w' ) f . write ( rep ) f . close ( )
Dump the class data in the format of a .netrc file.
Dump the class data in the format of a . netrc file .