diff --git a/python_libtorrent/__init__.py b/python_libtorrent/__init__.py index 19de182..8e519c8 100644 --- a/python_libtorrent/__init__.py +++ b/python_libtorrent/__init__.py @@ -26,7 +26,15 @@ else: 'python_libtorrent') log('dirname:' +str(dirname)) -dest_path = os.path.join(dirname, platform['system']) + +default_version=0 #0.16.19 +set_version=__settings__.getSetting('set_version') +if getSettingAsBool('custom_version'): + platform['version'] = __language__(1150+int(set_version)) +else: + platform['version'] = __language__(1150+default_version) + +dest_path = os.path.join(dirname, platform['system'], platform['version']) sys.path.insert(0, dest_path) lm=LibraryManager(dest_path) diff --git a/python_libtorrent/public.py b/python_libtorrent/public.py index 0ebc63e..811a4c7 100644 --- a/python_libtorrent/public.py +++ b/python_libtorrent/public.py @@ -14,7 +14,9 @@ class Public: self.root=os.path.dirname(__file__) for dir in os.listdir(self.root): if os.path.isdir(os.path.join(self.root,dir)): - self.platforms.append({'system':dir}) + for subdir in os.listdir(os.path.join(self.root,dir)): + if os.path.isdir(os.path.join(self.root,dir,subdir)): + self.platforms.append({'system':dir, 'version':subdir}) self._generate_size_file() def _generate_size_file( self ): @@ -22,28 +24,29 @@ class Public: for libname in get_libname(platform): self.libname=libname self.platform=platform - self.libdir = os.path.join(self.root, self.platform['system']) + self.libdir = os.path.join(self.root, self.platform['system'], self.platform['version']) self.libpath = os.path.join(self.libdir, self.libname) self.sizepath=self.libpath+'.size.txt' self.zipname=self.libname+'.zip' - self.zippath=os.path.join(self.libdir, self.zipname) + zippath=os.path.join(self.libdir, self.zipname) + system=platform['system']+'/'+platform['version']+'/' if os.path.exists(self.libpath): if not os.path.exists(self.sizepath): - print platform['system']+'/'+self.libname+' NO SIZE' + print system+self.libname+' NO SIZE' self._makezip() - elif not os.path.exists(self.zippath): - print platform['system']+'/'+self.libname+' NO ZIP' + elif not os.path.exists(zippath): + print system+self.libname+' NO ZIP' self._makezip() else: size=str(os.path.getsize(self.libpath)) size_old=open( self.sizepath, "r" ).read() if size_old!=size: - print platform['system']+'/'+self.libname+' NOT EQUAL' + print system+self.libname+' NOT EQUAL' self._makezip() else: - print platform['system']+'/'+self.libname+' NO ACTION' + print system+self.libname+' NO ACTION' else: - print platform['system']+'/'+self.libname+' NO LIB' + print system+self.libname+' NO LIB' def _makezip(self): open( self.sizepath, "w" ).write( str(os.path.getsize(self.libpath)) ) diff --git a/python_libtorrent/windows/1.0.6/libtorrent.pyd.size.txt b/python_libtorrent/windows/1.0.6/libtorrent.pyd.size.txt new file mode 100644 index 0000000..3c2fa28 --- /dev/null +++ b/python_libtorrent/windows/1.0.6/libtorrent.pyd.size.txt @@ -0,0 +1 @@ +2281472 \ No newline at end of file diff --git a/python_libtorrent/windows/1.0.6/libtorrent.pyd.zip b/python_libtorrent/windows/1.0.6/libtorrent.pyd.zip new file mode 100644 index 0000000..0149a89 Binary files /dev/null and b/python_libtorrent/windows/1.0.6/libtorrent.pyd.zip differ