model/Account.py
def create_id(self):
        """Creates an ID if there isn't one already"""

        try:
            with open(self.info_path) as f:
                self.__info = json.load(f)
        except IOError:
            if self.__username is None:
                raise UnspecifiedInformation("Username not provided")

            content = {
                "username": self.__username,
                "public_key": self.__public_key
            }

            content = hash_content(content, HASH_DIFFICULTY, 10**6)

            info = {
                "id": content,
                "node": self.__node,
                "transactions": self.__transactions
            }

            with open(self.info_path, 'w') as f:
                json.dump(info, f)
Creates an ID if there isn't one already
Creates an ID if there isn't one already
Creates an ID if there isn ' t one already
def create_id(self):
        try:
            with open(self.info_path) as f:
                self.__info = json.load(f)
        except IOError:
            if self.__username is None:
                raise UnspecifiedInformation("Username not provided")
            content = {
                "username": self.__username,
                "public_key": self.__public_key
            }
            content = hash_content(content, HASH_DIFFICULTY, 10**6)
            info = {
                "id": content,
                "node": self.__node,
                "transactions": self.__transactions
            }
            with open(self.info_path, 'w') as f:
                json.dump(info, f)
def create_id ( self ) : try : with open ( self . info_path ) as f : self . __info = json . load ( f ) except IOError : if self . __username is None : raise UnspecifiedInformation ( "Username not provided" ) content = { "username" : self . __username , "public_key" : self . __public_key } content = hash_content ( content , HASH_DIFFICULTY , 10 ** 6 ) info = { "id" : content , "node" : self . __node , "transactions" : self . __transactions } with open ( self . info_path , 'w' ) as f : json . dump ( info , f )
Creates an ID if there isn't one already
Creates an ID if there isn ' t one already
"""Creates an ID if there isn't one already"""
self