authomatic/core.py
def serialize(self):
        """
        Converts the credentials to a percent encoded string to be stored for
        later use.

        :returns:
            :class:`string`

        """

        if self.provider_id is None:
            raise ConfigError(
                'To serialize credentials you need to specify a '
                'unique integer under the "id" key in the config '
                'for each provider!')

        # Get the provider type specific items.
        rest = self.provider_type_class().to_tuple(self)

        # Provider ID and provider type ID are always the first two items.
        result = (self.provider_id, self.provider_type_id) + rest

        # Make sure that all items are strings.
        stringified = [str(i) for i in result]

        # Concatenate by newline.
        concatenated = '\n'.join(stringified)

        # Percent encode.
        return parse.quote(concatenated, '')
def serialize(self):
        if self.provider_id is None:
            raise ConfigError(
                'To serialize credentials you need to specify a '
                'unique integer under the "id" key in the config '
                'for each provider!')

        # Get the provider type specific items.
        rest = self.provider_type_class().to_tuple(self)

        # Provider ID and provider type ID are always the first two items.
        result = (self.provider_id, self.provider_type_id) + rest

        # Make sure that all items are strings.
        stringified = [str(i) for i in result]

        # Concatenate by newline.
        concatenated = '\n'.join(stringified)

        # Percent encode.
        return parse.quote(concatenated, '')
def serialize ( self ) : if self . provider_id is None : raise ConfigError ( 'To serialize credentials you need to specify a ' 'unique integer under the "id" key in the config ' 'for each provider!' ) # Get the provider type specific items. rest = self . provider_type_class ( ) . to_tuple ( self ) # Provider ID and provider type ID are always the first two items. result = ( self . provider_id , self . provider_type_id ) + rest # Make sure that all items are strings. stringified = [ str ( i ) for i in result ] # Concatenate by newline. concatenated = '\n' . join ( stringified ) # Percent encode. return parse . quote ( concatenated , '' )
Converts the credentials to a percent encoded string to be stored for
        later use.

        :returns:
            :class:`string`
Converts the credentials to a percent encoded string to be stored for later use .