~ubuntu-branches/ubuntu/precise/bittornado/precise

« back to all changes in this revision

Viewing changes to BitTornado/parsedir.py

  • Committer: Barry Warsaw
  • Date: 2011-08-10 23:17:46 UTC
  • mfrom: (7.1.1 bittornado)
  • Revision ID: barry@python.org-20110810231746-5buiob6p54m266s8
Tags: 0.3.18-10ubuntu2
* switch to dh_python2 (LP: #788514)
  - install btmakemetafile.py and btcompletedir.py via pyinstall
  - add build depend on python-all
  - bump debhelper depend to 7 for dh_auto_install

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
from bencode import bencode, bdecode
4
4
from BT1.btformats import check_info
5
5
from os.path import exists, isfile
6
 
from sha import sha
 
6
try:
 
7
    from hashlib import sha1 as sha
 
8
except ImportError:
 
9
    from sha import sha
7
10
import sys, os
8
11
 
9
12
try:
37
40
            if newtorrent:
38
41
                newtorrents = True
39
42
                p = os.path.join(directory, f)
40
 
                new_files[p] = [(os.path.getmtime(p), os.path.getsize(p)), 0]
 
43
                new_files[p] = [(int(os.path.getmtime(p)),
 
44
                                 os.path.getsize(p)), 0]
41
45
                torrent_type[p] = newtorrent
42
46
        if not newtorrents:
43
47
            for f in os.listdir(directory):