Example #1
0
    def __init__(self):
        QObject.__init__(self, None)

        self.base_path = get_base_path()
        if not is_frozen():
            self.base_path = os.path.join(get_base_path(), "..")

        self.request_mgr = None
        self.core_process = None
        self.events_manager = EventRequestManager()

        self.shutting_down = False
        self.recorded_stderr = ""
        self.use_existing_core = True

        self.stop_timer = QTimer()
        self.stop_timer.timeout.connect(self.check_stopped)

        self.check_state_timer = QTimer()
Example #2
0
    def __init__(self, api_port):
        QObject.__init__(self, None)

        self.base_path = get_base_path()
        if not is_frozen():
            self.base_path = os.path.join(get_base_path(), "..")

        self.request_mgr = None
        self.core_process = None
        self.api_port = api_port
        self.events_manager = EventRequestManager(self.api_port)

        self.shutting_down = False
        self.recorded_stderr = ""
        self.use_existing_core = True
        self.is_core_running = False

        self.stop_timer = QTimer()
        self.stop_timer.timeout.connect(self.check_stopped)

        self.check_state_timer = QTimer()
Example #3
0
def setup_logging():
    """
    Setup logging to write logs to files inside \
    .Tribler directory in each platforms
    """
    # First check if logger.conf is present or not
    log_config = os.path.join(get_base_path(), "logger.conf")

    if not os.path.exists(log_config):
        print "Log configuration file not found at location '%s'" % log_config
        return

    log_directory = os.path.abspath(
        os.environ.get('APPDATA', os.path.expanduser('~')))
    log_directory = os.path.join(log_directory, '.Tribler', 'logs')

    if not os.path.exists(log_directory):
        os.makedirs(log_directory)

    logging.info_log_file = '%s/tribler-info.log' % log_directory
    logging.error_log_file = '%s/tribler-error.log' % log_directory
    logging.config.fileConfig(log_config, disable_existing_loggers=False)
Example #4
0
"""
Provides a class which initializes a page with information about the Tribler network.
This is either a Network Explorer if the QWebEngineView import is available on the running platform or
a trust graph if it is not.
"""
import os
from PyQt5.QtCore import QUrl
from PyQt5.QtGui import QColor
from PyQt5.QtWidgets import QWidget
from TriblerGUI import utilities

NETWORK_EXPLORER_HTML_PATH = os.path.join(utilities.get_base_path(), "widgets/network_explorer/index.html")


class NetworkExplorerPage(QWidget):
    """
    The logic of the Network Explorer.
    """

    def __init__(self):
        """
        Create a new Network Explorer.
        """
        QWidget.__init__(self)
        self.network_graph = None

    def initialize_web_page(self):
        """
        Load the web page the QWidget.
        """
        try: