clos80 Posted May 4, 2009 Report Posted May 4, 2009 Hi,I've a little project to develop, basically I need to log some parameters while downloading files, so that I can create statistic and better understand how the torrent protocol works. So, what I've done, I've downloaded the source code of BitTorrent-5.2.2 (python code) and added the print of some interested variables. Now the problem is....how can I create my client version of BitTorrent in order to see what I'm printing and make my statistic?Thx, clos80
clos80 Posted May 5, 2009 Author Report Posted May 5, 2009 The thing is that I've a compiler (python 3.1a2), but I don't know which file I should start from. Maybe the good question is: Can I compile a new version on BitTorrent under Windows Vista? Or I need to do it under Linux?
Ultima Posted May 6, 2009 Report Posted May 6, 2009 Python... 3.1...? AFAIK, BitTorrent v5.x was written for older versions of Python (think v2.x), and Python v3.x breaks a lot of backwards compatibility with Python v2.x. You'd need an older version of Python, for starters.As for compiling... I haven't used Python in forever, but if I'm recalling correctly, the interpreter automatically compiles .py files to .pyo (or was it .pyc?) files when it runs the script, so shouldn't it already be doing that for you? There should be some kind of "main" file that you can execute to get things going -- exactly what file that is, I don't know, as I've never taken a look at BitTorrent's source code.
clos80 Posted May 7, 2009 Author Report Posted May 7, 2009 Ok...almost there, I've downloaded the 2.6.2 version, I think I've also found a "main" file (bittorrent-console.py). The problem now is that when I try to RUN it I got this error:Traceback (most recent call last): File "C:\Users\Claudio\Desktop\BitTorrent\BitTorrent-5.2.2\bittorrent-console.py", line 18, in <module> from BitTorrent.translation import _ File "C:\Users\Claudio\Desktop\BitTorrent\BitTorrent-5.2.2\BitTorrent\__init__.py", line 49, in <module> from BitTorrent.platform import get_temp_subdir, get_dot_dir, is_frozen_exe File "C:\Users\Claudio\Desktop\BitTorrent\BitTorrent-5.2.2\BitTorrent\platform.py", line 25, in <module> from BTL.platform import efs, efs2, get_filesystem_encoding File "C:\Users\Claudio\Desktop\BitTorrent\BitTorrent-5.2.2\BTL\platform.py", line 19, in <module> import win32apiImportError: No module named win32apithis "import" is used when bittorrent tries to find out which OS I'm usign (at least I think so). From the file platform.py I've:if os.name == 'nt': import pywintypes import winerror import _winreg #import BTL.likewin32api as win32api import win32api import win32file from win32com.shell import shellcon import win32con from twisted.python.shortcut import Shortcut import ctypes import structDo you have any idea about how I can fix this issue? Could it be a compatibility problem with Windows Vista?
Ultima Posted May 8, 2009 Report Posted May 8, 2009 Sounds to me like it's using some Python library called "win32api".http://python.net/crew/mhammond/win32/ - First result on Google for python win32apiSee this link if you still have some problems, I guess.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.