Jump to content

Create the client from the source code!


clos80

Recommended Posts

Posted

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

Posted

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?

Posted

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.

Posted

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 win32api

ImportError: No module named win32api

this "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 struct

Do you have any idea about how I can fix this issue? Could it be a compatibility problem with Windows Vista?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...