Skip to content
Snippets Groups Projects
Commit 7b7882f4 authored by inso's avatar inso
Browse files

Use relative imports everywhere

parent 240ffd80
Branches
Tags
No related merge requests found
...@@ -7,7 +7,7 @@ a = Analysis(['src/sakia/main.py'], ...@@ -7,7 +7,7 @@ a = Analysis(['src/sakia/main.py'],
pathex=['.'], pathex=['.'],
binaries=None, binaries=None,
datas=None, datas=None,
hiddenimports=[], hiddenimports=['six','packaging', 'packaging.version', 'packaging.specifiers'],
hookspath=['hooks'], hookspath=['hooks'],
runtime_hooks=[], runtime_hooks=[],
excludes=[], excludes=[],
......
...@@ -2,8 +2,8 @@ import logging ...@@ -2,8 +2,8 @@ import logging
import time import time
import networkx import networkx
from PyQt5.QtCore import QLocale, QDateTime, QObject from PyQt5.QtCore import QLocale, QDateTime, QObject
from sakia.tools.exceptions import NoPeerAvailable from ...tools.exceptions import NoPeerAvailable
from sakia.core.net.network import MAX_CONFIRMATIONS from ..net.network import MAX_CONFIRMATIONS
from .constants import EdgeStatus, NodeStatus from .constants import EdgeStatus, NodeStatus
...@@ -107,7 +107,6 @@ class BaseGraph(QObject): ...@@ -107,7 +107,6 @@ class BaseGraph(QObject):
QLocale.dateFormat(QLocale(), QLocale.ShortFormat) QLocale.dateFormat(QLocale(), QLocale.ShortFormat)
), ),
'cert_time': certifier['cert_time'], 'cert_time': certifier['cert_time'],
'confirmation_text': self.confirmation_text(certifier['block_number'])
} }
self.nx_graph.add_edge(certifier['identity'].pubkey, identity.pubkey, attr_dict=arc, weight=len(certifier_list)) self.nx_graph.add_edge(certifier['identity'].pubkey, identity.pubkey, attr_dict=arc, weight=len(certifier_list))
...@@ -145,7 +144,7 @@ class BaseGraph(QObject): ...@@ -145,7 +144,7 @@ class BaseGraph(QObject):
QLocale.dateFormat(QLocale(), QLocale.ShortFormat) QLocale.dateFormat(QLocale(), QLocale.ShortFormat)
), ),
'cert_time': certified['cert_time'], 'cert_time': certified['cert_time'],
'confirmation_text': self.confirmation_text(certified['block_number']) 'confirmation_text': self.confirmation_text(certified['cert_time'])
} }
self.nx_graph.add_edge(identity.pubkey, certified['identity'].pubkey, attr_dict=arc, self.nx_graph.add_edge(identity.pubkey, certified['identity'].pubkey, attr_dict=arc,
......
...@@ -3,7 +3,7 @@ import networkx ...@@ -3,7 +3,7 @@ import networkx
import asyncio import asyncio
from PyQt5.QtCore import pyqtSignal from PyQt5.QtCore import pyqtSignal
from .base_graph import BaseGraph from .base_graph import BaseGraph
from sakia.core.graph.constants import EdgeStatus, NodeStatus from ..graph.constants import EdgeStatus, NodeStatus
class ExplorerGraph(BaseGraph): class ExplorerGraph(BaseGraph):
...@@ -77,24 +77,17 @@ class ExplorerGraph(BaseGraph): ...@@ -77,24 +77,17 @@ class ExplorerGraph(BaseGraph):
logging.debug("New identity explored : {pubkey}".format(pubkey=current_identity.pubkey[:5])) logging.debug("New identity explored : {pubkey}".format(pubkey=current_identity.pubkey[:5]))
self.graph_changed.emit() self.graph_changed.emit()
certifier_coro = asyncio.ensure_future(current_identity.unique_valid_certifiers_of(self.app.identities_registry, certifier_list = await current_identity.unique_valid_certifiers_of(self.app.identities_registry,
self.community)) self.community)
await self.add_certifier_list(certifier_list, current_identity, identity)
certified_coro = asyncio.ensure_future(current_identity.unique_valid_certified_by(self.app.identities_registry,
self.community))
certifier_list, certified_list = await asyncio.gather(certifier_coro, certified_coro)
certifier_coro = asyncio.ensure_future(self.add_certifier_list(certifier_list,
current_identity, identity))
logging.debug("New identity certifiers : {pubkey}".format(pubkey=current_identity.pubkey[:5])) logging.debug("New identity certifiers : {pubkey}".format(pubkey=current_identity.pubkey[:5]))
certified_coro = asyncio.ensure_future(self.add_certified_list(certified_list, self.graph_changed.emit()
current_identity, identity))
certifier_coro.add_done_callback(lambda f: self.graph_changed.emit())
certified_coro.add_done_callback(lambda f: self.graph_changed.emit())
await asyncio.gather(certifier_coro, certified_coro)
certified_list = await current_identity.unique_valid_certified_by(self.app.identities_registry,
self.community)
await self.add_certified_list(certified_list, current_identity, identity)
logging.debug("New identity certified : {pubkey}".format(pubkey=current_identity.pubkey[:5])) logging.debug("New identity certified : {pubkey}".format(pubkey=current_identity.pubkey[:5]))
self.graph_changed.emit()
for cert in certified_list + certifier_list: for cert in certified_list + certifier_list:
if cert['identity'] not in explorable[step + 1]: if cert['identity'] not in explorable[step + 1]:
......
...@@ -11,7 +11,7 @@ from ucoinpy.documents.block import Block ...@@ -11,7 +11,7 @@ from ucoinpy.documents.block import Block
from ..tools.decorators import asyncify, once_at_a_time, cancel_once_task from ..tools.decorators import asyncify, once_at_a_time, cancel_once_task
from ..tools.exceptions import NoPeerAvailable from ..tools.exceptions import NoPeerAvailable
from sakia.gui.widgets.busy import Busy from .widgets.busy import Busy
@enum.unique @enum.unique
......
...@@ -6,8 +6,8 @@ Created on 22 mai 2014 ...@@ -6,8 +6,8 @@ Created on 22 mai 2014
import re import re
from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QMessageBox, QFileDialog from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QMessageBox, QFileDialog
from sakia.tools.exceptions import Error from ..tools.exceptions import Error
from sakia.gen_resources.import_account_uic import Ui_ImportAccountDialog from ..gen_resources.import_account_uic import Ui_ImportAccountDialog
class ImportAccountDialog(QDialog, Ui_ImportAccountDialog): class ImportAccountDialog(QDialog, Ui_ImportAccountDialog):
......
...@@ -27,7 +27,7 @@ from ..core import money ...@@ -27,7 +27,7 @@ from ..core import money
from ..core.community import Community from ..core.community import Community
from ..tools.decorators import asyncify from ..tools.decorators import asyncify
from ..__init__ import __version__ from ..__init__ import __version__
from sakia.gui.widgets import toast from .widgets import toast
class MainWindow(QMainWindow, Ui_MainWindow): class MainWindow(QMainWindow, Ui_MainWindow):
......
...@@ -17,7 +17,7 @@ from ..gen_resources.community_cfg_uic import Ui_CommunityConfigurationDialog ...@@ -17,7 +17,7 @@ from ..gen_resources.community_cfg_uic import Ui_CommunityConfigurationDialog
from ..models.peering import PeeringTreeModel from ..models.peering import PeeringTreeModel
from ..core import Community from ..core import Community
from ..core.net import Node from ..core.net import Node
from sakia.gui.widgets import toast from .widgets import toast
from .widgets.dialogs import QAsyncMessageBox from .widgets.dialogs import QAsyncMessageBox
from ..tools.decorators import asyncify from ..tools.decorators import asyncify
......
...@@ -10,7 +10,7 @@ from ..models.txhistory import HistoryTableModel, TxFilterProxyModel ...@@ -10,7 +10,7 @@ from ..models.txhistory import HistoryTableModel, TxFilterProxyModel
from ..tools.exceptions import NoPeerAvailable from ..tools.exceptions import NoPeerAvailable
from ..tools.decorators import asyncify, once_at_a_time, cancel_once_task from ..tools.decorators import asyncify, once_at_a_time, cancel_once_task
from .widgets.context_menu import ContextMenu from .widgets.context_menu import ContextMenu
from sakia.gui.widgets import toast from .widgets import toast
class TransactionsTabWidget(QObject): class TransactionsTabWidget(QObject):
......
...@@ -11,8 +11,8 @@ from PyQt5.QtCore import QRegExp, Qt, QObject ...@@ -11,8 +11,8 @@ from PyQt5.QtCore import QRegExp, Qt, QObject
from PyQt5.QtGui import QRegExpValidator from PyQt5.QtGui import QRegExpValidator
from ..gen_resources.transfer_uic import Ui_TransferMoneyDialog from ..gen_resources.transfer_uic import Ui_TransferMoneyDialog
from sakia.gui.widgets import toast from .widgets import toast
from sakia.gui.widgets.dialogs import QAsyncMessageBox, QMessageBox from .widgets.dialogs import QAsyncMessageBox, QMessageBox
from ..tools.decorators import asyncify from ..tools.decorators import asyncify
......
...@@ -2,8 +2,8 @@ import networkx ...@@ -2,8 +2,8 @@ import networkx
from PyQt5.QtCore import QPoint, pyqtSignal from PyQt5.QtCore import QPoint, pyqtSignal
from PyQt5.QtWidgets import QGraphicsScene from PyQt5.QtWidgets import QGraphicsScene
from sakia.gui.views.edges import WotEdge from ..edges import WotEdge
from sakia.gui.views.nodes import WotNode from ..nodes import WotNode
from .base_scene import BaseScene from .base_scene import BaseScene
......
...@@ -8,7 +8,7 @@ import logging ...@@ -8,7 +8,7 @@ import logging
from PyQt5.QtCore import Qt, QThread from PyQt5.QtCore import Qt, QThread
from PyQt5.QtWidgets import QMainWindow, QApplication from PyQt5.QtWidgets import QMainWindow, QApplication
from PyQt5.QtGui import QImage, QPixmap from PyQt5.QtGui import QImage, QPixmap
from sakia.gen_resources.toast_uic import Ui_Toast from ...gen_resources.toast_uic import Ui_Toast
window = None # global window = None # global
......
...@@ -18,8 +18,8 @@ import PyQt5.QtSvg ...@@ -18,8 +18,8 @@ import PyQt5.QtSvg
from quamash import QSelectorEventLoop from quamash import QSelectorEventLoop
from PyQt5.QtWidgets import QApplication from PyQt5.QtWidgets import QApplication
from sakia.gui.mainwindow import MainWindow from .gui.mainwindow import MainWindow
from sakia.core.app import Application from .core.app import Application
def async_exception_handler(loop, context): def async_exception_handler(loop, context):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment