~cmiller/ubuntu/quantal/deluge/fix-parameter-move-storage

« back to all changes in this revision

Viewing changes to libtorrent/bindings/python/src/create_torrent.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cristian Greco
  • Date: 2009-11-13 02:39:45 UTC
  • mfrom: (4.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091113023945-te1bybo2912ejzuc
Tags: 1.2.0~rc3-4
* debian/control: bump build-dep on python-setuptools to (>= 0.6c9).
* debian/patches:
  - 25_r5921_fastresume_files.patch
    new, should fix problems with fresh configs;
  - 30_r5931_ipc_lockfile.patch:
    new, should fix an issue where Deluge will fail to start if there is a
    stale ipc lockfile. (Closes: #555849)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright Daniel Wallin & Arvid Norberg 2009. Use, modification and distribution is
2
 
// subject to the Boost Software License, Version 1.0. (See accompanying
3
 
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4
 
 
5
 
#include <boost/python.hpp>
6
 
#include <libtorrent/create_torrent.hpp>
7
 
#include <libtorrent/file_storage.hpp>
8
 
#include "libtorrent/intrusive_ptr_base.hpp"
9
 
 
10
 
using namespace boost::python;
11
 
using namespace libtorrent;
12
 
 
13
 
void bind_create_torrent()
14
 
{
15
 
    void (file_storage::*add_file0)(file_entry const&) = &file_storage::add_file;
16
 
    void (file_storage::*add_file1)(fs::path const&, size_type) = &file_storage::add_file;
17
 
 
18
 
    class_<file_storage>("file_storage")
19
 
        .def("is_valid", &file_storage::is_valid)
20
 
        .def("add_file", add_file0)
21
 
        .def("add_file", add_file1)
22
 
        .def("num_files", &file_storage::num_files)
23
 
        .def("at", &file_storage::at, return_internal_reference<>())
24
 
        .def("total_size", &file_storage::total_size)
25
 
        .def("set_num_pieces", &file_storage::set_num_pieces)
26
 
        .def("num_pieces", &file_storage::num_pieces)
27
 
        .def("set_piece_length", &file_storage::set_piece_length)
28
 
        .def("piece_length", &file_storage::piece_length)
29
 
        .def("piece_size", &file_storage::piece_size)
30
 
        .def("set_name", &file_storage::set_name)
31
 
        .def("name", &file_storage::name, return_internal_reference<>())
32
 
        ;
33
 
 
34
 
    class_<create_torrent>("create_torrent", no_init)
35
 
        .def(init<file_storage&>())
36
 
        .def(init<file_storage&, int>())
37
 
 
38
 
        .def("generate", &create_torrent::generate)
39
 
 
40
 
        .def("files", &create_torrent::files, return_internal_reference<>())
41
 
        .def("set_comment", &create_torrent::set_comment)
42
 
        .def("set_creator", &create_torrent::set_creator)
43
 
        .def("set_hash", &create_torrent::set_hash)
44
 
        .def("add_url_seed", &create_torrent::add_url_seed)
45
 
        .def("add_node", &create_torrent::add_node)
46
 
        .def("add_tracker", &create_torrent::add_tracker)
47
 
        .def("set_priv", &create_torrent::set_priv)
48
 
        .def("num_pieces", &create_torrent::num_pieces)
49
 
        .def("piece_length", &create_torrent::piece_length)
50
 
        .def("piece_size", &create_torrent::piece_size)
51
 
        .def("priv", &create_torrent::priv)
52
 
        ;
53
 
}