[Python-modules-commits] r6261 - in packages/python-progressbar/trunk/debian (4 files)
morph-guest at users.alioth.debian.org
morph-guest at users.alioth.debian.org
Wed Aug 20 18:54:05 UTC 2008
Date: Wednesday, August 20, 2008 @ 18:54:04
Author: morph-guest
Revision: 6261
added upstream example, removing the other; added full license text
Added:
packages/python-progressbar/trunk/debian/examples/examples.py
Modified:
packages/python-progressbar/trunk/debian/changelog
packages/python-progressbar/trunk/debian/copyright
Deleted:
packages/python-progressbar/trunk/debian/examples/example1.py
Modified: packages/python-progressbar/trunk/debian/changelog
===================================================================
--- packages/python-progressbar/trunk/debian/changelog 2008-08-20 17:04:15 UTC (rev 6260)
+++ packages/python-progressbar/trunk/debian/changelog 2008-08-20 18:54:04 UTC (rev 6261)
@@ -1,5 +1,9 @@
python-progressbar (2.2-1) unstable; urgency=low
+ [ Sandro Tosi ]
* Initial release. (Closes: #495664)
- -- Sandro Tosi <matrixhasu at gmail.com> Wed, 20 Aug 2008 00:17:28 +0200
+ [ Piotr Ożarowski ]
+ * XS-DM-Upload-Allowed set to "yes"
+
+ -- Sandro Tosi <matrixhasu at gmail.com> Wed, 20 Aug 2008 20:48:55 +0200
Modified: packages/python-progressbar/trunk/debian/copyright
===================================================================
--- packages/python-progressbar/trunk/debian/copyright 2008-08-20 17:04:15 UTC (rev 6260)
+++ packages/python-progressbar/trunk/debian/copyright 2008-08-20 18:54:04 UTC (rev 6261)
@@ -18,8 +18,17 @@
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
-On a Debian system the complete text of the GNU General Public License v2.1
-can be found in the file `/usr/share/common-licenses/LGPL-2.1'.
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On a Debian system the complete text of the GNU Lesser General Public License
+v2.1 can be found in the file `/usr/share/common-licenses/LGPL-2.1'.
+
The Debian packaging is (C) 2008, Sandro Tosi <matrixhasu at gmail.com> and
is licensed under the LGPLv2.1, see `/usr/share/common-licenses/LGPL-2.1'.
Deleted: packages/python-progressbar/trunk/debian/examples/example1.py
===================================================================
--- packages/python-progressbar/trunk/debian/examples/example1.py 2008-08-20 17:04:15 UTC (rev 6260)
+++ packages/python-progressbar/trunk/debian/examples/example1.py 2008-08-20 18:54:04 UTC (rev 6261)
@@ -1,14 +0,0 @@
-#!/usr/bin/python
-
-# Taken from http://www.pythonbrasil.com.br/moin.cgi/BarraProgresso
-
-from progressbar import *
-
-def example1():
- widgets = ['Test: ', Percentage(), ' ', Bar(marker=RotatingMarker()),' ', ETA(), ' ', FileTransferSpeed()]
- pbar = ProgressBar(widgets=widgets, maxval=20000000).start()
- for i in range(2000000):
- pbar.update(10*i+1)
- pbar.finish()
-
-example1()
Added: packages/python-progressbar/trunk/debian/examples/examples.py
===================================================================
--- packages/python-progressbar/trunk/debian/examples/examples.py (rev 0)
+++ packages/python-progressbar/trunk/debian/examples/examples.py 2008-08-20 18:54:04 UTC (rev 6261)
@@ -0,0 +1,81 @@
+#!/usr/bin/python
+#
+# progressbar - Text progressbar library for python.
+# Copyright (c) 2005 Nilton Volpato
+#
+# Extracted from progressbar.py source code
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+from progressbar import *
+
+if __name__=='__main__':
+ import os
+
+ def example1():
+ widgets = ['Test: ', Percentage(), ' ', Bar(marker=RotatingMarker()),
+ ' ', ETA(), ' ', FileTransferSpeed()]
+ pbar = ProgressBar(widgets=widgets, maxval=10000000).start()
+ for i in range(1000000):
+ # do something
+ pbar.update(10*i+1)
+ pbar.finish()
+ print
+
+ def example2():
+ class CrazyFileTransferSpeed(FileTransferSpeed):
+ "It's bigger between 45 and 80 percent"
+ def update(self, pbar):
+ if 45 < pbar.percentage() < 80:
+ return 'Bigger Now ' + FileTransferSpeed.update(self,pbar)
+ else:
+ return FileTransferSpeed.update(self,pbar)
+
+ widgets = [CrazyFileTransferSpeed(),' <<<', Bar(), '>>> ', Percentage(),' ', ETA()]
+ pbar = ProgressBar(widgets=widgets, maxval=10000000)
+ # maybe do something
+ pbar.start()
+ for i in range(2000000):
+ # do something
+ pbar.update(5*i+1)
+ pbar.finish()
+ print
+
+ def example3():
+ widgets = [Bar('>'), ' ', ETA(), ' ', ReverseBar('<')]
+ pbar = ProgressBar(widgets=widgets, maxval=10000000).start()
+ for i in range(1000000):
+ # do something
+ pbar.update(10*i+1)
+ pbar.finish()
+ print
+
+ def example4():
+ widgets = ['Test: ', Percentage(), ' ',
+ Bar(marker='0',left='[',right=']'),
+ ' ', ETA(), ' ', FileTransferSpeed()]
+ pbar = ProgressBar(widgets=widgets, maxval=500)
+ pbar.start()
+ for i in range(100,500+1,50):
+ time.sleep(0.2)
+ pbar.update(i)
+ pbar.finish()
+ print
+
+
+ example1()
+ example2()
+ example3()
+ example4()
More information about the Python-modules-commits
mailing list