Skip to content

Commit

Permalink
Merge pull request #442 from shollingsworth/issue-439-python-module-c…
Browse files Browse the repository at this point in the history
…onflict-fix

fixes #439 - module namespace conflict
  • Loading branch information
gustavo-iniguez-goya authored Jun 18, 2021
2 parents 1c73a48 + de559dc commit 38e3bd4
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 45 deletions.
1 change: 1 addition & 0 deletions ui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ install:

opensnitch/resources_rc.py: translations deps
@pyrcc5 -o opensnitch/resources_rc.py opensnitch/res/resources.qrc
sed -i 's/^import ui_pb2/from . import ui_pb2/' opensnitch/ui_pb2*

translations:
@cd i18n ; make
Expand Down
2 changes: 1 addition & 1 deletion ui/opensnitch/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
from PyQt5 import QtCore
from database import Database
from opensnitch.database import Database

class Config:
__instance = None
Expand Down
10 changes: 5 additions & 5 deletions ui/opensnitch/dialogs/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
from PyQt5 import QtCore, QtGui, uic, QtWidgets
from PyQt5.QtCore import QCoreApplication as QC

from config import Config
from nodes import Nodes
from database import Database
from utils import Message
from opensnitch.config import Config
from opensnitch.nodes import Nodes
from opensnitch.database import Database
from opensnitch.utils import Message

import ui_pb2
from opensnitch import ui_pb2

DIALOG_UI_PATH = "%s/../res/preferences.ui" % os.path.dirname(sys.modules[__name__].__file__)
class PreferencesDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
Expand Down
8 changes: 4 additions & 4 deletions ui/opensnitch/dialogs/processdetails.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

from PyQt5 import QtCore, QtGui, uic, QtWidgets

import ui_pb2
from nodes import Nodes
from desktop_parser import LinuxDesktopParser
from utils import Message
from opensnitch import ui_pb2
from opensnitch.nodes import Nodes
from opensnitch.desktop_parser import LinuxDesktopParser
from opensnitch.utils import Message

DIALOG_UI_PATH = "%s/../res/process_details.ui" % os.path.dirname(sys.modules[__name__].__file__)
class ProcessDetailsDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
Expand Down
9 changes: 4 additions & 5 deletions ui/opensnitch/dialogs/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@

from slugify import slugify

from desktop_parser import LinuxDesktopParser
from config import Config
from version import version

import ui_pb2
from opensnitch.desktop_parser import LinuxDesktopParser
from opensnitch.config import Config
from opensnitch.version import version
from opensnitch import ui_pb2

DIALOG_UI_PATH = "%s/../res/prompt.ui" % os.path.dirname(sys.modules[__name__].__file__)
class PromptDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
Expand Down
12 changes: 6 additions & 6 deletions ui/opensnitch/dialogs/ruleseditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
import json
import sys
import os
import ui_pb2
from opensnitch import ui_pb2
import time
import ipaddress

from config import Config
from nodes import Nodes
from database import Database
from version import version
from utils import Message, FileDialog
from opensnitch.config import Config
from opensnitch.nodes import Nodes
from opensnitch.database import Database
from opensnitch.version import version
from opensnitch.utils import Message, FileDialog

DIALOG_UI_PATH = "%s/../res/ruleseditor.ui" % os.path.dirname(sys.modules[__name__].__file__)
class RulesEditorDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
Expand Down
18 changes: 9 additions & 9 deletions ui/opensnitch/dialogs/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
from PyQt5 import QtCore, QtGui, uic, QtWidgets
from PyQt5.QtCore import QCoreApplication as QC

import ui_pb2
from config import Config
from version import version
from nodes import Nodes
from dialogs.preferences import PreferencesDialog
from dialogs.ruleseditor import RulesEditorDialog
from dialogs.processdetails import ProcessDetailsDialog
from customwidgets import ColorizedDelegate, ConnectionsTableModel
from utils import Message
from opensnitch import ui_pb2
from opensnitch.config import Config
from opensnitch.version import version
from opensnitch.nodes import Nodes
from opensnitch.dialogs.preferences import PreferencesDialog
from opensnitch.dialogs.ruleseditor import RulesEditorDialog
from opensnitch.dialogs.processdetails import ProcessDetailsDialog
from opensnitch.customwidgets import ColorizedDelegate, ConnectionsTableModel
from opensnitch.utils import Message

DIALOG_UI_PATH = "%s/../res/stats.ui" % os.path.dirname(sys.modules[__name__].__file__)
class StatsDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
Expand Down
4 changes: 2 additions & 2 deletions ui/opensnitch/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import time
import json

import ui_pb2
from database import Database
from opensnitch import ui_pb2
from opensnitch.database import Database

class Nodes():
__instance = None
Expand Down
24 changes: 12 additions & 12 deletions ui/opensnitch/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
path = os.path.abspath(os.path.dirname(__file__))
sys.path.append(path)

import ui_pb2
import ui_pb2_grpc

from dialogs.prompt import PromptDialog
from dialogs.stats import StatsDialog

from nodes import Nodes
from config import Config
from version import version
from database import Database
from utils import Utils
from version import version
from opensnitch import ui_pb2
from opensnitch import ui_pb2_grpc

from opensnitch.dialogs.prompt import PromptDialog
from opensnitch.dialogs.stats import StatsDialog

from opensnitch.nodes import Nodes
from opensnitch.config import Config
from opensnitch.version import version
from opensnitch.database import Database
from opensnitch.utils import Utils
from opensnitch.version import version

class UIService(ui_pb2_grpc.UIServicer, QtWidgets.QGraphicsObject):
_new_remote_trigger = QtCore.pyqtSignal(str, ui_pb2.PingRequest)
Expand Down
2 changes: 1 addition & 1 deletion ui/opensnitch/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

from PyQt5 import QtCore, QtWidgets
from version import version
from opensnitch.version import version
import pwd
import socket
import fcntl
Expand Down

0 comments on commit 38e3bd4

Please sign in to comment.