Skip to content

Commit

Permalink
Merge pull request #2393 from whirm/next_to_devel
Browse files Browse the repository at this point in the history
Next to devel
  • Loading branch information
whirm authored Jul 1, 2016
2 parents 3ee8432 + f067eb2 commit 63f49df
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 62 deletions.
4 changes: 2 additions & 2 deletions Tribler/Core/Libtorrent/LibtorrentDownloadImpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
if sys.platform == "win32":
try:
import ctypes
except:
except ImportError:
pass


Expand Down Expand Up @@ -684,7 +684,7 @@ def set_selected_files(self, selected_files=None):
if sys.platform == "win32":
ctypes.windll.kernel32.SetFileAttributesW(
unwanteddir_abs, 2) # 2 = FILE_ATTRIBUTE_HIDDEN
except:
except OSError:
self._logger.error("LibtorrentDownloadImpl: could not create %s" % unwanteddir_abs)
# Note: If the destination directory can't be accessed, libtorrent will not be able to store the files.
# This will result in a DLSTATUS_STOPPED_ON_ERROR.
Expand Down
3 changes: 2 additions & 1 deletion Tribler/Core/Utilities/twisted_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def isInThreadPool():
"""
Check if we are currently on one of twisted threadpool threads.
"""
return bool(reactor.threadpool) and current_thread() in reactor.threadpool.threads
threadpool = reactor.getThreadPool()
return threadpool is not None and current_thread() in threadpool.threads


#
Expand Down
8 changes: 4 additions & 4 deletions Tribler/Core/osutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,16 @@ def get_desktop_dir():
elif is_android():

def get_home_dir():
return os.path.realpath(os.environ['ANDROID_PRIVATE'])
return os.path.realpath(unicode(os.environ['ANDROID_PRIVATE']))

def get_appstate_dir():
return os.path.join(get_home_dir(), '.Tribler')
return os.path.join(get_home_dir(), u'.Tribler')

def get_picture_dir():
return os.path.join(get_desktop_dir(), 'DCIM')
return os.path.join(get_desktop_dir(), u'DCIM')

def get_desktop_dir():
return os.path.realpath(os.environ['EXTERNAL_STORAGE'])
return os.path.realpath(unicode(os.environ['EXTERNAL_STORAGE']))

else:
# linux or darwin (mac)
Expand Down
7 changes: 6 additions & 1 deletion Tribler/Main/Dialogs/systray.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Author : Choopan RATTANAPOKA, Jie Yang, Arno Bakker
# see LICENSE.txt for license information
import sys
import wx
from traceback import print_exc
from Tribler.Main.Utility.utility import speed_format
Expand Down Expand Up @@ -42,7 +43,11 @@ def updateTooltip(self, download_speed=0, upload_speed=0):
def updateIcon(self, iconifying=False):
remove = True

mintray = self.utility.read_config('mintray')
if sys.platform == 'win32':
mintray = 2
else:
mintray = self.utility.read_config('mintray')

if (mintray >= 2) or ((mintray >= 1) and iconifying):
remove = False

Expand Down
2 changes: 1 addition & 1 deletion Tribler/Main/Utility/GuiDBHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def startWorker(
filename, line, function, _ = extract_stack(limit=2)[0]
_, filename = os.path.split(filename)
jobID = u"%s:%s (%s)" % (filename, line, function)
except:
except IndexError:
pass

result = ASyncDelayedResult(jobID)
Expand Down
1 change: 1 addition & 0 deletions Tribler/community/multichain/community.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ def _get_latest_hash(self):

def unload_community(self):
self.logger.debug("Unloading the MultiChain Community.")
self.notifier.remove_observer(self.on_tunnel_remove)
super(MultiChainCommunity, self).unload_community()
# Close the persistence layer
self.persistence.close()
Expand Down
145 changes: 92 additions & 53 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,62 +1,101 @@
from distutils.core import setup
from Tribler.Core.version import version_id


with open('README.rst', 'r') as f:
long_description = f.read()

with open('Tribler/LICENSE.txt', 'r') as f:
licenses = f.read()

packages = [
'Tribler',
'Tribler.Category',
'Tribler.Core',
'Tribler.Core.APIImplementation',
'Tribler.Core.CacheDB',
'Tribler.Core.Config',
'Tribler.Core.DecentralizedTracking',
'Tribler.Core.DecentralizedTracking.pymdht',
'Tribler.Core.DecentralizedTracking.pymdht.core',
'Tribler.Core.DecentralizedTracking.pymdht.plugins',
'Tribler.Core.DecentralizedTracking.pymdht.profiler',
'Tribler.Core.DecentralizedTracking.pymdht.profiler.parsers',
'Tribler.Core.DecentralizedTracking.pymdht.ui',
'Tribler.Core.DecentralizedTracking.pymdht.ut2mdht',
'Tribler.Core.Libtorrent',
'Tribler.Core.Modules',
'Tribler.Core.Modules.channel',
'Tribler.Core.Modules.restapi',
'Tribler.Core.Modules.restapi.channels',
'Tribler.Core.TFTP',
'Tribler.Core.TorrentChecker',
'Tribler.Core.Upgrade',
'Tribler.Core.Utilities',
'Tribler.Core.Video',
'Tribler.Main',
'Tribler.Main.Dialogs',
'Tribler.Main.Emercoin',
'Tribler.Main.Utility',
'Tribler.Main.vwxGUI',
'Tribler.Main.webUI',
'Tribler.Policies',
'Tribler.Utilities',
'Tribler.community',
'Tribler.community.allchannel',
'Tribler.community.bartercast4',
'Tribler.community.channel',
'Tribler.community.demers',
'Tribler.community.multichain',
'Tribler.community.search',
'Tribler.community.template',
'Tribler.community.tunnel',
'Tribler.community.tunnel.Socks5',
'Tribler.community.tunnel.crypto',
'Tribler.dispersy',
'Tribler.dispersy.discovery',
'Tribler.dispersy.libnacl.libnacl',
'Tribler.dispersy.tool',
'Tribler.dispersy.tracker',
]

test_suite = [
'Tribler.dispersy.tests',
'Tribler.dispersy.tests.debugcommunity',
'Tribler.Test',
'Tribler.Test.API',
'Tribler.Test.Category',
'Tribler.Test.Category.data.Tribler.Category',
'Tribler.Test.Community',
'Tribler.Test.Community.Bartercast',
'Tribler.Test.Community.Multichain',
'Tribler.Test.Community.Tunnel',
'Tribler.Test.Core',
'Tribler.Test.Core.data.config_files',
'Tribler.Test.Core.data.libtorrent',
'Tribler.Test.Core.data.sqlite_scripts',
'Tribler.Test.Core.data.torrent_creation_files',
'Tribler.Test.Core.data.upgrade_databases',
'Tribler.Test.Core.Libtorrent',
'Tribler.Test.Core.Modules',
'Tribler.Test.Core.Modules.channel',
'Tribler.Test.Core.Modules.Channel',
'Tribler.Test.Core.Modules.RestApi',
'Tribler.Test.Core.Modules.RestApi.Channels',
'Tribler.Test.Core.Upgrade',
'Tribler.Test.data',
'Tribler.Test.data.41aea20908363a80d44234e8fef07fab506cd3b4',
'Tribler.Test.data.contentdir',
]

setup(
name='libtribler',
description='Tribler core functionality package',
long_description=long_description,
license=licenses,
version=str(version_id),
author='Tribler',
packages=[
'Tribler',
'Tribler.Category',
'Tribler.Core',
'Tribler.Core.APIImplementation',
'Tribler.Core.CacheDB',
'Tribler.Core.Config',
'Tribler.Core.DecentralizedTracking',
'Tribler.Core.DecentralizedTracking.pymdht',
'Tribler.Core.DecentralizedTracking.pymdht.core',
'Tribler.Core.DecentralizedTracking.pymdht.plugins',
'Tribler.Core.DecentralizedTracking.pymdht.profiler',
'Tribler.Core.DecentralizedTracking.pymdht.profiler.parsers',
'Tribler.Core.DecentralizedTracking.pymdht.ui',
'Tribler.Core.DecentralizedTracking.pymdht.ut2mdht',
'Tribler.Core.Libtorrent',
'Tribler.Core.Modules',
'Tribler.Core.Modules.channel',
'Tribler.Core.Modules.restapi',
'Tribler.Core.TFTP',
'Tribler.Core.TorrentChecker',
'Tribler.Core.Upgrade',
'Tribler.Core.Utilities',
'Tribler.Core.Video',
'Tribler.Main',
'Tribler.Main.Dialogs',
'Tribler.Main.Emercoin',
'Tribler.Main.Utility',
'Tribler.Main.vwxGUI',
'Tribler.Main.webUI',
'Tribler.Utilities',
'Tribler.community',
'Tribler.community.allchannel',
'Tribler.community.bartercast4',
'Tribler.community.channel',
'Tribler.community.demers',
'Tribler.community.multichain',
'Tribler.community.search',
'Tribler.community.template',
'Tribler.community.tunnel',
'Tribler.community.tunnel.Socks5',
'Tribler.community.tunnel.crypto',
'Tribler.dispersy',
'Tribler.dispersy.discovery',
'Tribler.dispersy.libnacl.libnacl',
'Tribler.dispersy.tool',
'Tribler.dispersy.tracker',
],

url='https://github.com/Tribler/tribler',
license='LICENSE.txt',
description='AT3 package for Python for Android',
author='Tribler team from Delft University of Technology',
package_data={
'Tribler': [
'schema_sdb_v28.sql',
Expand All @@ -68,5 +107,5 @@
'bootstrap_stable',
'bootstrap_unstable'],
},
long_description='This is the core tribler functionality package which is used for the android app.',
packages=packages,
)

0 comments on commit 63f49df

Please sign in to comment.