Skip to content

Commit

Permalink
Fix run_tribler.py
Browse files Browse the repository at this point in the history
  • Loading branch information
drew2a committed Mar 9, 2022
1 parent eba15a4 commit 3d6a9fc
Show file tree
Hide file tree
Showing 19 changed files with 58 additions and 58 deletions.
14 changes: 7 additions & 7 deletions src/run_tribler.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import os
import sys

from tribler_core.components.reporter.exception_handler import default_core_exception_handler
from tribler_core.sentry_reporter.sentry_reporter import SentryStrategy
from tribler_core.sentry_reporter.sentry_scrubber import SentryScrubber
from tribler.core.components.reporter.exception_handler import default_core_exception_handler
from tribler.core.sentry_reporter.sentry_reporter import SentryStrategy
from tribler.core.sentry_reporter.sentry_scrubber import SentryScrubber

logger = logging.getLogger(__name__)

Expand All @@ -35,7 +35,7 @@ def init_sentry_reporter():
test mode
"""
sentry_reporter = default_core_exception_handler.sentry_reporter
from tribler_core.version import sentry_url, version_id
from tribler.core.version import sentry_url, version_id
test_sentry_url = sentry_reporter.get_test_sentry_url()

if not test_sentry_url:
Expand Down Expand Up @@ -66,7 +66,7 @@ def init_boot_logger():
logger.info(f'Run Tribler: {parsed_args}')

# Get root state directory (e.g. from environment variable or from system default)
from tribler_core.utilities.osutils import get_root_state_directory
from tribler.core.utilities.osutils import get_root_state_directory

root_state_dir = get_root_state_directory()
logger.info(f'Root state dir: {root_state_dir}')
Expand All @@ -76,10 +76,10 @@ def init_boot_logger():

# Check whether we need to start the core or the user interface
if parsed_args.core:
from tribler_core.start_core import run_core
from tribler.core.start_core import run_core

run_core(api_port, api_key, root_state_dir, parsed_args)
else: # GUI
from tribler_gui.start_gui import run_gui
from tribler.gui.start_gui import run_gui

run_gui(api_port, api_key, root_state_dir, parsed_args)
2 changes: 1 addition & 1 deletion src/tribler/core/components/tag/tag_component.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import tribler_core.components.metadata_store.metadata_store_component as metadata_store_component
import tribler.core.components.metadata_store.metadata_store_component as metadata_store_component
from tribler.core.components.base import Component
from tribler.core.components.ipv8.ipv8_component import Ipv8Component
from tribler.core.components.key.key_component import KeyComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import pytest

import tribler_core.components.torrent_checker.torrent_checker.torrent_checker as torrent_checker_module
import tribler.core.components.torrent_checker.torrent_checker.torrent_checker as torrent_checker_module
from tribler.core.components.torrent_checker.torrent_checker.torrent_checker import TorrentChecker
from tribler.core.components.torrent_checker.torrent_checker.torrentchecker_session import HttpTrackerSession, \
UdpSocketManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async def test_start(version_check_manager, version_server):
# We only start the version check if GIT is not in the version ID.
assert not version_check_manager.is_pending_task_active("tribler version check")

import tribler_core.components.version_check.versioncheck_manager as vcm # pylint: disable=reimported, import-outside-toplevel
import tribler.core.components.version_check.versioncheck_manager as vcm # pylint: disable=reimported, import-outside-toplevel
old_id = vcm.version_id
vcm.version_id = "7.0.0"
version_check_manager.start()
Expand Down Expand Up @@ -148,7 +148,7 @@ async def test_version_check_api_timeout(free_port, version_check_manager, versi
response = json.dumps({'name': NEW_VERSION_ID})
response_lag = 2 # Ensures that it takes 2 seconds to send a response

import tribler_core.components.version_check.versioncheck_manager as vcm # pylint: disable=reimported, import-outside-toplevel
import tribler.core.components.version_check.versioncheck_manager as vcm # pylint: disable=reimported, import-outside-toplevel
old_timeout = vcm.VERSION_CHECK_TIMEOUT
vcm.VERSION_CHECK_TIMEOUT = 1 # version checker will wait for 1 second to get response

Expand All @@ -172,7 +172,7 @@ async def test_fallback_on_multiple_urls(free_port, version_check_manager, versi
global response # pylint: disable=global-statement
response = json.dumps({'name': NEW_VERSION_ID})

import tribler_core.components.version_check.versioncheck_manager as vcm # pylint: disable=reimported, import-outside-toplevel
import tribler.core.components.version_check.versioncheck_manager as vcm # pylint: disable=reimported, import-outside-toplevel
vcm_old_urls = vcm.VERSION_CHECK_URLS
vcm.VERSION_CHECK_URLS = ["http://this.will.not.exist", f"http://localhost:{free_port}"]

Expand Down
2 changes: 1 addition & 1 deletion src/tribler/core/upgrade/tests/test_version_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import pytest

import tribler_core.version
import tribler.core.version
from tribler.core.tests.tools.common import TESTS_DATA_DIR
from tribler.core.upgrade.version_manager import (
TriblerVersion,
Expand Down
4 changes: 2 additions & 2 deletions src/tribler/core/upgrade/version_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from tribler.core.utilities.simpledefs import STATEDIR_CHANNELS_DIR, STATEDIR_CHECKPOINT_DIR, STATEDIR_DB_DIR

import tribler_core.version
import tribler.core.version

VERSION_HISTORY_FILENAME = "version_history.json"

Expand Down Expand Up @@ -193,7 +193,7 @@ class VersionHistory:
# pylint: disable=too-many-branches
def __init__(self, root_state_dir: Path, code_version_id: Optional[str] = None):
if code_version_id is None:
code_version_id = tribler_core.version.version_id
code_version_id = tribler.core.version.version_id

self.root_state_dir = root_state_dir
self.file_path = root_state_dir / VERSION_HISTORY_FILENAME
Expand Down
4 changes: 2 additions & 2 deletions src/tribler/core/utilities/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ def get_dependencies(scope: Scope) -> Iterator[str]:
def _get_path_to_requirements_txt() -> Optional[Path]:
requirements_txt = 'requirements.txt'
if scope == Scope.core:
import tribler_core
import tribler.core
return Path(tribler_core.__file__).parent / requirements_txt
if scope == Scope.gui:
import tribler_gui
import tribler.gui
return Path(tribler_gui.__file__).parent / requirements_txt
raise AttributeError(f'Scope is {scope} but should be in {[s for s in Scope]}') # pylint: disable=unnecessary-comprehension

Expand Down
4 changes: 2 additions & 2 deletions src/tribler/core/utilities/install_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""
import sys

import tribler_core
import tribler.core
from tribler.core.utilities.path_util import Path
from tribler.core.utilities.utilities import is_frozen

Expand All @@ -16,7 +16,7 @@ def get_base_path():
# PyInstaller creates a temp folder and stores path in _MEIPASS
base_path = Path(sys._MEIPASS)
except Exception:
base_path = Path(tribler_core.__file__).parent
base_path = Path(tribler.core.__file__).parent

fixed_filename = Path.fix_win_long_file(base_path)
return Path(fixed_filename)
Expand Down
2 changes: 1 addition & 1 deletion src/tribler/core/utilities/tests/test_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
get_dependencies,
)

import tribler_core
import tribler.core
from tribler.core.utilities.path_util import Path

pytestmark = pytest.mark.asyncio
Expand Down
2 changes: 1 addition & 1 deletion src/tribler/gui/qt_resources/add_tags_dialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ margin-top: 4px;
<customwidget>
<class>TagsLineEdit</class>
<extends>QLineEdit</extends>
<header>tribler_gui.widgets.tagslineedit.h</header>
<header>tribler.gui.widgets.tagslineedit.h</header>
</customwidget>
</customwidgets>
<resources/>
Expand Down
6 changes: 3 additions & 3 deletions src/tribler/gui/qt_resources/channel_description.ui
Original file line number Diff line number Diff line change
Expand Up @@ -368,17 +368,17 @@
<customwidget>
<class>ClickableLabel</class>
<extends>QLabel</extends>
<header>tribler_gui.widgets.clickablewidgets.h</header>
<header>tribler.gui.widgets.clickablewidgets.h</header>
</customwidget>
<customwidget>
<class>UnderlineTabButton</class>
<extends>QToolButton</extends>
<header>tribler_gui.widgets.underlinetabbutton.h</header>
<header>tribler.gui.widgets.underlinetabbutton.h</header>
</customwidget>
<customwidget>
<class>TabButtonPanel</class>
<extends>QWidget</extends>
<header>tribler_gui.widgets.tabbuttonpanel.h</header>
<header>tribler.gui.widgets.tabbuttonpanel.h</header>
<container>1</container>
</customwidget>
</customwidgets>
Expand Down
2 changes: 1 addition & 1 deletion src/tribler/gui/qt_resources/feedback_dialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ background-color: #303030;
<customwidget>
<class>EllipseButton</class>
<extends>QToolButton</extends>
<header>tribler_gui.widgets.ellipsebutton.h</header>
<header>tribler.gui.widgets.ellipsebutton.h</header>
</customwidget>
</customwidgets>
<resources/>
Expand Down
34 changes: 17 additions & 17 deletions src/tribler/gui/qt_resources/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -5612,96 +5612,96 @@ background: none;</string>
<customwidget>
<class>TorrentFileTreeWidget</class>
<extends>QTreeWidget</extends>
<header>tribler_gui.widgets.torrentfiletreewidget.h</header>
<header>tribler.gui.widgets.torrentfiletreewidget.h</header>
</customwidget>
<customwidget>
<class>EllipseButton</class>
<extends>QToolButton</extends>
<header>tribler_gui.widgets.ellipsebutton.h</header>
<header>tribler.gui.widgets.ellipsebutton.h</header>
</customwidget>
<customwidget>
<class>UnderlineTabButton</class>
<extends>QToolButton</extends>
<header>tribler_gui.widgets.underlinetabbutton.h</header>
<header>tribler.gui.widgets.underlinetabbutton.h</header>
</customwidget>
<customwidget>
<class>TabButtonPanel</class>
<extends>QWidget</extends>
<header>tribler_gui.widgets.tabbuttonpanel.h</header>
<header>tribler.gui.widgets.tabbuttonpanel.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>SettingsPage</class>
<extends>QWidget</extends>
<header>tribler_gui.widgets.settingspage.h</header>
<header>tribler.gui.widgets.settingspage.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>DownloadsPage</class>
<extends>QWidget</extends>
<header>tribler_gui.widgets.downloadspage.h</header>
<header>tribler.gui.widgets.downloadspage.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>DownloadsDetailsTabWidget</class>
<extends>QTabWidget</extends>
<header>tribler_gui.widgets.downloadsdetailstabwidget.h</header>
<header>tribler.gui.widgets.downloadsdetailstabwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>LoadingPage</class>
<extends>QWidget</extends>
<header>tribler_gui.widgets.loadingpage.h</header>
<header>tribler.gui.widgets.loadingpage.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>DiscoveringPage</class>
<extends>QWidget</extends>
<header>tribler_gui.widgets.discoveringpage.h</header>
<header>tribler.gui.widgets.discoveringpage.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>CircleButton</class>
<extends>QToolButton</extends>
<header>tribler_gui.widgets.circlebutton.h</header>
<header>tribler.gui.widgets.circlebutton.h</header>
</customwidget>
<customwidget>
<class>DownloadProgressBar</class>
<extends>QWidget</extends>
<header>tribler_gui.widgets.downloadprogressbar.h</header>
<header>tribler.gui.widgets.downloadprogressbar.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>TrustPage</class>
<extends>QWidget</extends>
<header>tribler_gui.widgets.trustpage.h</header>
<header>tribler.gui.widgets.trustpage.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ChannelContentsWidget</class>
<extends>QWidget</extends>
<header>tribler_gui.widgets.channelcontentswidget.h</header>
<header>tribler.gui.widgets.channelcontentswidget.h</header>
</customwidget>
<customwidget>
<class>TrustGraphPage</class>
<extends>QWidget</extends>
<header>tribler_gui.widgets.trustgraphpage.h</header>
<header>tribler.gui.widgets.trustgraphpage.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ClickableLineEdit</class>
<extends>QLineEdit</extends>
<header>tribler_gui.widgets.clickable_line_edit.h</header>
<header>tribler.gui.widgets.clickable_line_edit.h</header>
</customwidget>
<customwidget>
<class>ChannelsMenuListWidget</class>
<extends>QListWidget</extends>
<header>tribler_gui.widgets.channelsmenulistwidget.h</header>
<header>tribler.gui.widgets.channelsmenulistwidget.h</header>
</customwidget>
<customwidget>
<class>SearchResultsWidget</class>
<extends>QWidget</extends>
<header>tribler_gui.widgets.searchresultswidget.h</header>
<header>tribler.gui.widgets.searchresultswidget.h</header>
</customwidget>
</customwidgets>
<resources/>
Expand Down
2 changes: 1 addition & 1 deletion src/tribler/gui/qt_resources/qtbug.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<customwidget>
<class>QtBug</class>
<extends>QWidget</extends>
<header>tribler_gui.widgets.qtbug.h</header>
<header>tribler.gui.widgets.qtbug.h</header>
<container>0</container>
</customwidget>
</customwidgets>
Expand Down
6 changes: 3 additions & 3 deletions src/tribler/gui/qt_resources/search_results.ui
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,17 @@
<customwidget>
<class>EllipseButton</class>
<extends>QToolButton</extends>
<header>tribler_gui.widgets.ellipsebutton.h</header>
<header>tribler.gui.widgets.ellipsebutton.h</header>
</customwidget>
<customwidget>
<class>ChannelContentsWidget</class>
<extends>QWidget</extends>
<header>tribler_gui.widgets.channelcontentswidget.h</header>
<header>tribler.gui.widgets.channelcontentswidget.h</header>
</customwidget>
<customwidget>
<class>TimeoutProgressBar</class>
<extends>QProgressBar</extends>
<header>tribler_gui.widgets.timeoutprogressbar.h</header>
<header>tribler.gui.widgets.timeoutprogressbar.h</header>
<container>1</container>
</customwidget>
</customwidgets>
Expand Down
4 changes: 2 additions & 2 deletions src/tribler/gui/qt_resources/startdownloaddialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -560,12 +560,12 @@ background: yellow;
<customwidget>
<class>ClickableLabel</class>
<extends>QLabel</extends>
<header>tribler_gui.widgets.clickablewidgets.h</header>
<header>tribler.gui.widgets.clickablewidgets.h</header>
</customwidget>
<customwidget>
<class>TorrentFileTreeWidget</class>
<extends>QTreeWidget</extends>
<header>tribler_gui.widgets.torrentfiletreewidget.h</header>
<header>tribler.gui.widgets.torrentfiletreewidget.h</header>
</customwidget>
</customwidgets>
<resources/>
Expand Down
14 changes: 7 additions & 7 deletions src/tribler/gui/qt_resources/torrents_list.ui
Original file line number Diff line number Diff line change
Expand Up @@ -838,39 +838,39 @@ QTableView::item::hover {
<customwidget>
<class>EllipseButton</class>
<extends>QToolButton</extends>
<header>tribler_gui.widgets.ellipsebutton.h</header>
<header>tribler.gui.widgets.ellipsebutton.h</header>
</customwidget>
<customwidget>
<class>QtBug</class>
<extends>QWidget</extends>
<header>tribler_gui.widgets.qtbug.h</header>
<header>tribler.gui.widgets.qtbug.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>SubscriptionsWidget</class>
<extends>QWidget</extends>
<header>tribler_gui.widgets.subscriptionswidget.h</header>
<header>tribler.gui.widgets.subscriptionswidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>TriblerContentTableView</class>
<extends>QTableView</extends>
<header>tribler_gui.widgets.lazytableview.h</header>
<header>tribler.gui.widgets.lazytableview.h</header>
</customwidget>
<customwidget>
<class>ToggleButton</class>
<extends>QWidget</extends>
<header>tribler_gui.widgets.togglebutton.h</header>
<header>tribler.gui.widgets.togglebutton.h</header>
</customwidget>
<customwidget>
<class>ChannelDescriptionWidget</class>
<extends>QWidget</extends>
<header>tribler_gui.widgets.channeldescriptionwidget.h</header>
<header>tribler.gui.widgets.channeldescriptionwidget.h</header>
</customwidget>
<customwidget>
<class>InstantTooltipButton</class>
<extends>QToolButton</extends>
<header>tribler_gui.widgets.instanttooltipbutton.h</header>
<header>tribler.gui.widgets.instanttooltipbutton.h</header>
</customwidget>
</customwidgets>
<resources/>
Expand Down
Loading

0 comments on commit 3d6a9fc

Please sign in to comment.