Skip to content

Commit

Permalink
Version 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kz26 committed Aug 27, 2016
1 parent edf9416 commit 5e856e8
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 29 deletions.
6 changes: 4 additions & 2 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

1.2.0
-----
* Switch to BEP 19 (GetRight style) web seeds

1.1.1
-----
* Return True/False in generate()
Expand All @@ -18,13 +22,11 @@ Changelog

1.0.1
-----

* Change bencoder.pyx minimum version dependency to 1.1.1
* Add none/now to CLI date option
* Minor tweaks


1.0.0
-----

* Initial release.
14 changes: 7 additions & 7 deletions docs/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ available in your system path.

::

usage: dottorrent_cli.py [-h] [--tracker TRACKER] [--http_seed HTTP_SEED]
[--piece_size PIECE_SIZE] [--private]
[--comment COMMENT] [--date DATE] [--md5] [--verbose]
path output_path
usage: dottorrent_cli.py [-h] [--tracker TRACKER] [--web_seed WEB_SEED]
[--piece_size PIECE_SIZE] [--private]
[--comment COMMENT] [--date DATE] [--md5] [--verbose]
path output_path

Create a .torrent file

Expand All @@ -23,8 +23,8 @@ available in your system path.
-h, --help show this help message and exit
--tracker TRACKER, -t TRACKER
tracker URL (can be specified multiple times)
--http_seed HTTP_SEED, -w HTTP_SEED
HTTP seed URL (can be specified multiple times)
--web_seed WEB_SEED, -w WEB_SEED
web seed URL (can be specified multiple times)
--piece_size PIECE_SIZE, -s PIECE_SIZE
piece size in bytes
--private, -p set private flag
Expand All @@ -35,4 +35,4 @@ available in your system path.
--md5 Add per-file MD5 hashes
--verbose, -v verbose mode

dottorrent/1.0.1 (https://github.com/kz26/dottorrent)
dottorrent/1.2.0 (https://github.com/kz26/dottorrent)
4 changes: 3 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@
# built documents.
#
# The short X.Y version.
version = '1.1.1'
with open('../dottorrent/version.py') as f:
exec(f.read())
version = __version__
# The full version, including alpha/beta/rc tags.
release = version

Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Features

* Fast (capable of several hundred MB/s)
* Automatic and manual piece size selection
* HTTP/web seeds support
* Private flag support
* HTTP/web seeds support `(BEP 19) <http://www.bittorrent.org/beps/bep_0019.html>`_
* Private flag support `(BEP 27) <http://www.bittorrent.org/beps/bep_0027.html>`_
* Info hash generation for created torrents
* User-definable comment field, creation date, creator, etc.
* Per-file MD5 hash inclusion
Expand Down
20 changes: 10 additions & 10 deletions dottorrent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ def print_err(v):

class Torrent(object):

def __init__(self, path, trackers=None, http_seeds=None,
def __init__(self, path, trackers=None, web_seeds=None,
piece_size=None, private=False, creation_date=None,
comment=None, created_by=None, include_md5=False):
"""
:param path: path to a file or directory from which to create the torrent
:param trackers: list/iterable of tracker URLs
:param http_seeds: list/iterable of HTTP seed URLs
:param web_seeds: list/iterable of HTTP/FTP seed URLs
:param piece_size: Piece size in bytes. Must be >= 16 KB and a power of 2.
If None, ``get_info()`` will be used to automatically select a piece size.
:param private: The private flag. If True, DHT/PEX will be disabled.
Expand All @@ -67,7 +67,7 @@ def __init__(self, path, trackers=None, http_seeds=None,

self.path = os.path.normpath(path)
self.trackers = trackers
self.http_seeds = http_seeds
self.web_seeds = web_seeds
self.piece_size = piece_size
self.private = private
self.creation_date = creation_date
Expand All @@ -92,11 +92,11 @@ def trackers(self, value):
self._trackers = tl

@property
def http_seeds(self):
return self._http_seeds
def web_seeds(self):
return self._web_seeds

@http_seeds.setter
def http_seeds(self, value):
@web_seeds.setter
def web_seeds(self, value):
tl = []
if value:
for t in value:
Expand All @@ -105,7 +105,7 @@ def http_seeds(self, value):
tl.append(t)
else:
raise Exception("{} is not a valid URL".format(t))
self._http_seeds = tl
self._web_seeds = tl

@property
def piece_size(self):
Expand Down Expand Up @@ -243,8 +243,8 @@ def generate(self, callback=None):
data['created by'] = DEFAULT_CREATOR
if self.creation_date:
data['creation date'] = int(self.creation_date.timestamp())
if self.http_seeds:
data['httpseeds'] = self.http_seeds
if self.web_seeds:
data['url-list'] = self.web_seeds
data['info'] = OrderedDict()
if single_file:
data['info']['length'] = files[0][1]
Expand Down
12 changes: 6 additions & 6 deletions dottorrent/dottorrent_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
metavar='TRACKER',
help='tracker URL (can be specified multiple times)')
parser.add_argument(
'--http_seed', '-w', action='append', dest='http_seeds',
metavar='HTTP_SEED',
help='HTTP seed URL (can be specified multiple times)')
'--web_seed', '-w', action='append', dest='web_seeds',
metavar='WEB_SEED',
help='web seed URL (can be specified multiple times)')
parser.add_argument(
'--piece_size', '-s', type=int, help='piece size in bytes')
parser.add_argument(
Expand Down Expand Up @@ -71,7 +71,7 @@
print("Input: {}".format(args.path))
t = dottorrent.Torrent(args.path,
trackers=args.trackers,
http_seeds=args.http_seeds,
web_seeds=args.web_seeds,
piece_size=args.piece_size,
private=args.private,
comment=args.comment,
Expand All @@ -86,8 +86,8 @@
print("MD5 hashing: {}".format(args.md5))
for x in t.trackers:
print("Tracker: " + x)
for x in t.http_seeds:
print("HTTP seed: " + x)
for x in t.web_seeds:
print("Web seed: " + x)
print("Private torrent: {}".format(args.private))
if args.comment:
print("Comment: " + t.comment)
Expand Down
2 changes: 1 addition & 1 deletion dottorrent/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.1.1'
__version__ = '1.2.0'

0 comments on commit 5e856e8

Please sign in to comment.