Skip to content

Commit

Permalink
fix rebase error diff
Browse files Browse the repository at this point in the history
  • Loading branch information
ardhipoetra committed Apr 25, 2016
1 parent 16e9fa3 commit c3538bd
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 78 deletions.
19 changes: 10 additions & 9 deletions Tribler/Core/Libtorrent/LibtorrentDownloadImpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from Tribler.Core.DownloadState import DownloadState
from Tribler.Core.Libtorrent import checkHandleAndSynchronize, waitForHandleAndSynchronize
from Tribler.Core.TorrentDef import TorrentDefNoMetainfo, TorrentDef
from Tribler.Core.Utilities.torrent_utils import get_info_from_handle
from Tribler.Core.osutils import fix_filebasename
from Tribler.Core.simpledefs import (DLSTATUS_WAITING4HASHCHECK, DLSTATUS_HASHCHECKING, DLSTATUS_METADATA,
DLSTATUS_DOWNLOADING, DLSTATUS_SEEDING, DLSTATUS_ALLOCATING_DISKSPACE,
Expand Down Expand Up @@ -311,16 +312,16 @@ def network_create_engine_wrapper(self, pstate, initialdlstatus=None, share_mode
if self.handle:
self.set_selected_files()

# set_selected_files sets priorities to 1, so we must set
# share_mode again, but first we must unset it, otherwise
# set_share_mode doesn't do anything
if share_mode:
self.handle.set_share_mode(not share_mode)
self.handle.set_share_mode(share_mode)
# set_selected_files sets priorities to 1, so we must set
# share_mode again, but first we must unset it, otherwise
# set_share_mode doesn't do anything
if share_mode:
self.handle.set_share_mode(not share_mode)
self.handle.set_share_mode(share_mode)

# If we lost resume_data always resume download in order to force checking
if initialdlstatus != DLSTATUS_STOPPED or not resume_data:
self.handle.resume()
# If we lost resume_data always resume download in order to force checking
if initialdlstatus != DLSTATUS_STOPPED or not resume_data:
self.handle.resume()

# If we only needed to perform checking, pause download after it is complete
self.pause_after_next_hashcheck = initialdlstatus == DLSTATUS_STOPPED
Expand Down
24 changes: 0 additions & 24 deletions Tribler/Core/Libtorrent/LibtorrentMgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,30 +324,6 @@ def process_alert(self, alert):
else:
self._logger.debug("LibtorrentMgr: alert for invalid torrent")

def reachability_check(self):
# obsolete function
return

# if self.ltsession and self.ltsession.status().has_incoming_connections:
# self.trsession.lm.threadpool.add_task(self.trsession.lm.dialback_reachable_callback, 3)
# else:
# self.trsession.lm.threadpool.add_task(self.reachability_check, 10)

def monitor_dht(self, infohash, chances_remaining=1):
# obsolete function
return

# Sometimes the dht fails to start. To workaround this issue we monitor the #dht_nodes, and restart if needed.
# if self.ltsession:
# if self.get_dht_nodes() <= 25:
# if self.get_dht_nodes() >= 5 and chances_remaining:
# self._logger.info("LibtorrentMgr: giving the dht a chance (%d, %d)", self.ltsession.status().dht_nodes, chances_remaining)
# self.trsession.lm.threadpool.add_task(lambda: self.monitor_dht(chances_remaining - 1), 5)
# else:
# self._logger.debug("could not find torrent %s", infohash)
# else:
# self._logger.debug("alert for invalid torrent")

def get_peers(self, infohash, callback, timeout=30):
def on_metainfo_retrieved(metainfo, infohash=infohash, callback=callback):
callback(infohash, metainfo.get('initial peers', []))
Expand Down
2 changes: 1 addition & 1 deletion Tribler/Main/Utility/GuiDBTuples.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def __init__(self, torrent_id, infohash, name, length, category, status, num_see

@cacheProperty
def torrent_id(self):
self._logger.error("Torrent: fetching getTorrentID from DB %s", self)
self._logger.debug("Torrent: fetching getTorrentID from DB %s", self)
return self.torrent_db.getTorrentID(self.infohash)

def update_torrent_id(self, torrent_id):
Expand Down
3 changes: 2 additions & 1 deletion Tribler/Main/tribler_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,12 +790,13 @@ def sesscb_ntfy_torrentupdates(self, events):
torrent = t.torrent if isinstance(t, CollectedTorrent) else t
self.frame.librarydetailspanel.setTorrent(torrent)

def sesscb_ntfy_torrentfinished(self, subject, changeType, infohash, *args):
def sesscb_ntfy_torrentfinished(self, subject, changeType, objectID, *args):
self.guiUtility.Notify(
"Download Completed", "Torrent '%s' has finished downloading. Now seeding." %
args[0], icon='seed')

if self._frame_and_ready():
infohash = objectID
torrent = self.guiUtility.torrentsearch_manager.getTorrentByInfohash(infohash)
# Check if we got the actual torrent as the bandwith investor
# downloads aren't going to be there.
Expand Down
26 changes: 1 addition & 25 deletions Tribler/Main/vwxGUI/GuiUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,34 +251,11 @@ def ShowPage(self, page, *args):
self.frame.librarylist.Show(False)

if page == 'creditmining':
# Show list
# self.frame.creditmininglist.Show(True)
#
# # Open infohash
# if args:
# self.frame.creditmininglist.GetManager().refresh_or_expand(args[0])
# else:
# items = self.frame.creditmininglist.GetExpandedItems()
# if items:
# items[0][1].expanded = False
# self.frame.creditmininglist.Select(items[0][0])
#
# # Open infohash
# if args:
# self.frame.creditmininglist.GetManager().refresh_or_expand(args[0])

self.frame.creditminingpanel.Show(True)

elif self.guiPage == 'creditmining':
self.frame.creditminingpanel.Show(False)

if page == 'cmbeta':
# Show list
self.frame.creditminingpanel.Show(True)
elif self.guiPage == 'cmbeta':
# Hide list
self.frame.creditminingpanel.Show(False)

if page == 'home':
self.frame.home.ResetSearchBox()
self.frame.home.Show()
Expand Down Expand Up @@ -682,8 +659,7 @@ def toggleFamilyFilter(self, newState=None, setCheck=False):
if setCheck:
self.frame.SRstatusbar.ff_checkbox.SetValue(newState)

# we don't use this panel in credit mining
# self.frame.home.aw_panel.refreshNow()
self.frame.home.aw_panel.refreshNow()

if newState:
self.utility.write_config('family_filter', 1)
Expand Down
6 changes: 0 additions & 6 deletions Tribler/Main/vwxGUI/MainFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ def __init__(self, abc, parent, internalvideo):
self.searchlist.Show(False)
self.librarylist = LibraryList(self.splitter_top_window)
self.librarylist.Show(False)
# self.creditmininglist = CreditMiningList(self)
# self.creditmininglist.Show(False)
self.channellist = ChannelList(self.splitter_top_window)
self.channellist.Show(False)
self.selectedchannellist = SelectedChannelList(self.splitter_top_window)
Expand Down Expand Up @@ -245,9 +243,6 @@ def OnShowSplitter(event):
event.Skip()
self.splitter.Bind(wx.EVT_SHOW, OnShowSplitter)

# self.creditmininglist = CreditMiningList(self)
# self.creditmininglist.Show(False)

self.stats = Stats(self)
self.stats.Show(False)
self.managechannel = ManageChannel(self)
Expand All @@ -271,7 +266,6 @@ def OnShowSplitter(event):
hSizer.Add(self.stats, 1, wx.EXPAND)
hSizer.Add(self.networkgraph, 1, wx.EXPAND)
hSizer.Add(self.splitter, 1, wx.EXPAND)
# hSizer.Add(self.creditmininglist, 1, wx.EXPAND)

hSizer.Add(self.managechannel, 1, wx.EXPAND)

Expand Down
13 changes: 3 additions & 10 deletions Tribler/Main/vwxGUI/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -2524,8 +2524,6 @@ def __SetData(self):
if sys.platform != 'darwin':
data_list.append((6, ['Videoplayer'], None, ActivityListItem))

# data_list.append((7, ['CM List beta'], None, ActivityListItem))

self.list.SetData(data_list)
self.ResizeListItems()
self.DisableItem(2)
Expand All @@ -2535,8 +2533,6 @@ def __SetData(self):
self.DisableCollapse()
self.selectTab('home')

# self.list.GetItem(7).num_items.Show(False)

# Create expanded panels in advance
channels_item = self.list.GetItem(3)
self.expandedPanel_channels = ChannelsExpandedPanel(channels_item)
Expand Down Expand Up @@ -2626,8 +2622,6 @@ def OnExpand(self, item):
return self.expandedPanel_videoplayer
elif item.data[0] == 'Credit Mining':
self.guiutility.ShowPage('creditmining')
elif item.data[0] == 'CM List beta':
self.guiutility.ShowPage('cmbeta')
return True

def OnCollapse(self, item, panel, from_expand):
Expand Down Expand Up @@ -2693,10 +2687,9 @@ def selectTab(self, tab):
elif tab == 'my_files':
itemKey = 4
elif tab == 'videoplayer':
itemKey = 5
itemKey = 6
# elif tab == 'cmbeta':
# itemKey = 7
elif tab == 'creditmining':
itemKey = 5
if itemKey:
wx.CallAfter(self.Select, itemKey, True)
return
Expand All @@ -2717,7 +2710,7 @@ def _DoPage(self, increment):
if curPage < 0:
curPage = len(pages) - 1

pageNames = ['home', 'search_results', 'channels', 'my_files', 'creditmining', 'videoplayer']#, 'cmbeta']
pageNames = ['home', 'search_results', 'channels', 'my_files', 'creditmining', 'videoplayer']
for i in self.settings.keys():
pageNames.pop(i - 1)
self.guiutility.ShowPage(pageNames[curPage])
2 changes: 1 addition & 1 deletion Tribler/Main/vwxGUI/list_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ def __init__(self, *args, **kwargs):

def AddComponents(self, leftSpacer, rightSpacer):
ListItem.AddComponents(self, leftSpacer, rightSpacer)
if self.data[0] in ['Results', 'Channels', 'Downloads', 'Credit Mining', 'Videoplayer', 'CM List beta']:
if self.data[0] in ['Results', 'Channels', 'Downloads', 'Credit Mining', 'Videoplayer']:
self.num_items = TagText(self, -1, label='0', fill_colour=GRADIENT_DGREY, edge_colour=SEPARATOR_GREY)
self.hSizer.Add(self.num_items, 0, wx.CENTER | wx.RIGHT, 5)
self.hSizer.Layout()
Expand Down
42 changes: 42 additions & 0 deletions Tribler/bootstraptribler.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0
127.0.0.1 0

0 comments on commit c3538bd

Please sign in to comment.