Ejemplo n.º 1
0
Archivo: app.py Proyecto: duniter/sakia
    async def remove_connection(self, connection):
        connections_processor = ConnectionsProcessor.instanciate(self)
        connections_processor.remove_connections(connection)

        CertificationsProcessor.instanciate(self).cleanup_connection(connection, connections_processor.pubkeys())
        IdentitiesProcessor.instanciate(self).cleanup_connection(connection)

        SourcesProcessor.instanciate(self).drop_all_of(currency=connection.currency, pubkey=connection.pubkey)

        DividendsProcessor.instanciate(self).cleanup_connection(connection)

        TransactionsProcessor.instanciate(self).cleanup_connection(connection, connections_processor.pubkeys())

        self.db.commit()
        self.connection_removed.emit(connection)
Ejemplo n.º 2
0
    async def remove_connection(self, connection):
        connections_processor = ConnectionsProcessor.instanciate(self)
        connections_processor.remove_connections(connection)

        CertificationsProcessor.instanciate(self).cleanup_connection(
            connection, connections_processor.pubkeys())
        IdentitiesProcessor.instanciate(self).cleanup_connection(connection)

        SourcesProcessor.instanciate(self).drop_all_of(
            currency=connection.currency, pubkey=connection.pubkey)

        DividendsProcessor.instanciate(self).cleanup_connection(connection)

        TransactionsProcessor.instanciate(self).cleanup_connection(
            connection, connections_processor.pubkeys())

        self.db.commit()
Ejemplo n.º 3
0
 def __init__(self, app, connection):
     super().__init__()
     self.app = app
     self.connection = connection
     self._connections_processor = ConnectionsProcessor.instanciate(
         self.app)
     self._identities_processor = IdentitiesProcessor.instanciate(self.app)
     self._blockchain_processor = BlockchainProcessor.instanciate(self.app)
Ejemplo n.º 4
0
 def __attrs_post_init__(self):
     super().__init__()
     self._connections_processor = ConnectionsProcessor.instanciate(
         self.app)
     self._certifications_processor = CertificationsProcessor.instanciate(
         self.app)
     self._identities_processor = IdentitiesProcessor.instanciate(self.app)
     self._blockchain_processor = BlockchainProcessor.instanciate(self.app)
Ejemplo n.º 5
0
Archivo: app.py Proyecto: eliadem/sakia
    async def remove_connection(self, connection):
        await self.stop_current_profile()
        connections_processor = ConnectionsProcessor.instanciate(self)
        connections_processor.remove_connections(connection)

        IdentitiesProcessor.instanciate(self).cleanup_connection(connection)

        CertificationsProcessor.instanciate(self).cleanup_connection(connection, connections_processor.pubkeys())

        SourcesProcessor.instanciate(self).drop_all_of(currency=connection.currency, pubkey=connection.pubkey)

        DividendsProcessor.instanciate(self).cleanup_connection(connection)

        TransactionsProcessor.instanciate(self).cleanup_connection(connection, connections_processor.pubkeys())

        if not connections_processor.connections():
            NodesProcessor.instanciate(self).drop_all(self.currency)

        self.db.commit()
        self.start_coroutines()
Ejemplo n.º 6
0
    def __init__(self, parent, app):
        """

        :param sakia.gui.search_user.controller.NetworkController parent: the controller
        :param sakia.app.Application app: the app
        """
        super().__init__(parent)
        self.app = app
        self.identities_processor = IdentitiesProcessor.instanciate(app)
        self._nodes = list()
        self._current_identity = None
Ejemplo n.º 7
0
 def instanciate(cls, app):
     """
     Instanciate a blockchain processor
     :param sakia.app.Application app: the app
     """
     return cls(BmaConnector(NodesProcessor(app.db.nodes_repo), app.parameters),
                BlockchainProcessor.instanciate(app),
                IdentitiesProcessor.instanciate(app),
                CertificationsProcessor.instanciate(app),
                TransactionsProcessor.instanciate(app),
                SourcesProcessor.instanciate(app))
Ejemplo n.º 8
0
 def instanciate(cls, app):
     """
     Instanciate a blockchain processor
     :param sakia.app.Application app: the app
     """
     return cls(BmaConnector(NodesProcessor(app.db.nodes_repo), app.parameters),
                BlockchainProcessor.instanciate(app),
                IdentitiesProcessor.instanciate(app),
                CertificationsProcessor.instanciate(app),
                TransactionsProcessor.instanciate(app),
                SourcesProcessor.instanciate(app))
Ejemplo n.º 9
0
    def __init__(self, parent, app):
        """

        :param sakia.gui.search_user.controller.NetworkController parent: the controller
        :param sakia.app.Application app: the app
        """
        super().__init__(parent)
        self.app = app
        self.identities_processor = IdentitiesProcessor.instanciate(app)
        self.contacts_processor = ContactsProcessor.instanciate(app)
        self._nodes = list()
        self._current_identity = None
Ejemplo n.º 10
0
 def create(cls, parent, app):
     """
     Instanciate a AccountConfigController component
     :param sakia.gui.component.controller.ComponentController parent:
     :param sakia.app.Application app:
     :return: a new AccountConfigController controller
     :rtype: AccountConfigController
     """
     view = ConnectionConfigView(parent.view if parent else None)
     model = ConnectionConfigModel(None, app, None,
                                   IdentitiesProcessor.instanciate(app))
     account_cfg = cls(parent, view, model)
     model.setParent(account_cfg)
     view.set_license(app.currency)
     return account_cfg
Ejemplo n.º 11
0
 async def check_registered(self):
     identities_processor = IdentitiesProcessor.instanciate(self.app)
     return await identities_processor.check_registered(self.connection)
Ejemplo n.º 12
0
 def __attrs_post_init__(self):
     super().__init__()
     self._connections_processor = ConnectionsProcessor.instanciate(self.app)
     self._certifications_processor = CertificationsProcessor.instanciate(self.app)
     self._identities_processor = IdentitiesProcessor.instanciate(self.app)
     self._blockchain_processor = BlockchainProcessor.instanciate(self.app)