Added print statement back in, changed to rev 0.0.5, (1.0 will include unit tests, and CLI), update README
Browse files- README.md +3 -2
- pytube/__init__.py +1 -1
- pytube/models.py +5 -0
README.md
CHANGED
@@ -27,8 +27,9 @@ or you can get the [source code from github](https://github.com/NFicano/python-y
|
|
27 |
|
28 |
The only features I see implementing in the near future are:
|
29 |
|
30 |
-
-
|
31 |
-
-
|
|
|
32 |
|
33 |
## Usage Example
|
34 |
|
|
|
27 |
|
28 |
The only features I see implementing in the near future are:
|
29 |
|
30 |
+
- refactor console printing into separate command-line utility.
|
31 |
+
- Add nosetests
|
32 |
+
- Add Sphinx documentation
|
33 |
|
34 |
## Usage Example
|
35 |
|
pytube/__init__.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
__title__ = 'pytube'
|
2 |
-
__version__ = '
|
3 |
__author__ = 'Nick Ficano'
|
4 |
__license__ = 'MIT License'
|
5 |
__copyright__ = 'Copyright 2013 Nick Ficano'
|
|
|
1 |
__title__ = 'pytube'
|
2 |
+
__version__ = '0.0.5'
|
3 |
__author__ = 'Nick Ficano'
|
4 |
__license__ = 'MIT License'
|
5 |
__copyright__ = 'Copyright 2013 Nick Ficano'
|
pytube/models.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
from os.path import normpath
|
2 |
from urllib2 import urlopen
|
3 |
|
@@ -46,6 +47,10 @@ class Video(object):
|
|
46 |
|
47 |
self._bytes_received += len(self._buffer)
|
48 |
dst_file.write(self._buffer)
|
|
|
|
|
|
|
|
|
49 |
|
50 |
def __repr__(self):
|
51 |
"""A cleaner representation of the class instance."""
|
|
|
1 |
+
from __future__ import unicode_literals
|
2 |
from os.path import normpath
|
3 |
from urllib2 import urlopen
|
4 |
|
|
|
47 |
|
48 |
self._bytes_received += len(self._buffer)
|
49 |
dst_file.write(self._buffer)
|
50 |
+
percent = self._bytes_received * 100. / file_size
|
51 |
+
status = r"%10d [%3.2f%%]" % (self._bytes_received, percent)
|
52 |
+
status = status + chr(8) * (len(status) + 1)
|
53 |
+
print status,
|
54 |
|
55 |
def __repr__(self):
|
56 |
"""A cleaner representation of the class instance."""
|