Permalink
Browse files

Removed some files

  • Loading branch information...
1 parent 110c44a commit 5c97c1f2249fddec6ad136f425d8902cb0ce21cf @xeBuz committed Oct 25, 2012
@@ -1,21 +0,0 @@
-Metadata-Version: 1.1
-Name: PacmanProgressbar
-Version: 0.2
-Summary: Progressbar based on Arch's Pacman progressbar
-Home-page: https://github.com/xeBuz/pacman-progressbar
-Author: Jesús F. Roldán
-Author-email: jesus.roldan@gmail.com
-License: LICENSE.txt
-Description: Pacman-progressbar
- ==================
-
- ProgreessBar for Python, based on Arch progressbar, with "ILoveCandy"
-
-
-
-Platform: UNKNOWN
-Classifier: Development Status :: 3 - Alpha
-Classifier: Environment :: Console
-Classifier: License :: OSI Approved :: BSD License
-Classifier: Programming Language :: Python :: 3
-Classifier: Topic :: Utilities
@@ -1,6 +0,0 @@
-PacmanProgressbar.py
-setup.py
-PacmanProgressbar.egg-info/PKG-INFO
-PacmanProgressbar.egg-info/SOURCES.txt
-PacmanProgressbar.egg-info/dependency_links.txt
-PacmanProgressbar.egg-info/top_level.txt
@@ -1 +0,0 @@
-
@@ -1 +0,0 @@
-PacmanProgressbar
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,88 +0,0 @@
-#!/usr/bin/env python3
-
-import sys
-import os
-import itertools
-
-MARGIN = 3
-DEFAULT_WIDTH = int(os.popen('stty size', 'r').read().split()[1]) - MARGIN
-
-PACMAN = ["\033[1;33mC\033[m", "\033[1;33mc\033[m"]
-CANDY = ["\033[0;37mo\033[m", "\033[0;37m \033[m", "\033[0;37m \033[m"]
-
-
-class Pacman():
- """ PacMan Progress Bar:
- Parameters:
- Start: It should be 0
- End: Defines the dimension of the bar in an amount of items or steps
- Width: Size (in chars) of the bar. Default = Console Size
- Step: Current position in the progrressbar, Default 0
- Text: Write some text at the beginning of the line
- """
- def __init__(self, Start=0, End=100, Width=-1, Step=0, Text=''):
- self.start = Start
- self.end = End
-
- self.percentage = 0
- self.step = Step
-
- if (Text != ''):
- self.text = Text + ': '
- else:
- self.text = ''
-
- self.len = self.end - self.start
-
- if ((Width - MARGIN) in range(0, DEFAULT_WIDTH)):
- self.width = Width - MARGIN
- else:
- self.width = DEFAULT_WIDTH
-
- self.bar = "-"
- self.pacman = itertools.cycle(PACMAN)
- self.candy = itertools.cycle(CANDY)
- self.candybar = [None] * self.width
-
- for i in range(self.width):
- self.candybar[i] = next(self.candy)
-
- for i in range(len(self.candybar)):
- self.__write(self.candybar[i])
- self.__write("]")
-
- def update(self, value=1):
- """ Update the progress in the bar
- Parameter: value, is the incresing size of the bar. By default 1
- """
- self.step = self.step + value
- self.__draw()
-
- def progress(self, value):
- """ Set the progress in the bar
- Parameter: value, is the specify size of the bar. No default value
- """
- self.step = value
- self.__draw()
-
- def __write(self, value='', encode='UTF-8'):
- sys.stdout.buffer.write(bytes(value, encode))
-
- def __set_percentage(self):
- self.percentage = format((100 * float(self.step) / float(self.end)), '.1f')
-
- def __draw(self):
-
- self.__set_percentage()
-
- porc = "\r" + str(self.text) + str(self.percentage) + "%["
- pos = (((self.step / (self.end - self.start) * 100) * (self.width - len(porc))) / 100)
-
- self.__write(porc)
-
- for i in range(int(pos)):
- self.__write(self.bar)
-
- self.__write(next(self.pacman))
-
- sys.stdout.flush()
@@ -1,97 +0,0 @@
-#!/usr/bin/env python
-# coding: UTF-8
-
-# pacmanprogress.py
-
-import sys
-import os
-import itertools
-
-__version__ = "0.3"
-
-MARGIN = 3
-DEFAULT_WIDTH = int(os.popen('stty size', 'r').read().split()[1]) - MARGIN
-
-PACMAN = ["\033[1;33mC\033[m", "\033[1;33mc\033[m"]
-CANDY = ["\033[0;37mo\033[m", "\033[0;37m \033[m", "\033[0;37m \033[m"]
-
-
-class Pacman():
- """PacMan Progress Bar"""
-
- def __init__(self, start=0, end=100, width=-1, step=0, text=''):
- """Create a new instance
-
- Parameters:
- start: It should be 0
- end: Defines the bar's dimenssion in an amount of items or steps
- width: Size (in chars) of the bar. Default = Console Size
- step: Current position in the progrressbar, Default 0
- text: Write some text at the beginning of the line
-
- """
- self.start = start
- self.end = end
- self.percentage = 0
- self.step = step
- if (text != ''):
- self.text = text + ': '
- else:
- self.text = ''
- self.len = self.end - self.start
-
- if ((width - MARGIN) in range(0, DEFAULT_WIDTH)):
- self.width = width - MARGIN
- else:
- self.width = DEFAULT_WIDTH
-
- self.bar = "-"
- self.pacman = itertools.cycle(PACMAN)
- self.candy = itertools.cycle(CANDY)
- self.candybar = [None] * self.width
-
- for i in range(self.width):
- self.candybar[i] = next(self.candy)
-
- for i in range(len(self.candybar)):
- self._write(self.candybar[i])
- self._write("]")
-
- def _write(self, value='', encode='UTF-8'):
- if sys.version_info.major == 3:
- sys.stdout.buffer.write(bytes(value, encode))
- else:
- sys.stdout.write(value)
-
- def _set_percentage(self):
- step = float(self.step)
- end = float(self.end)
- self.percentage = format((100 * step / end), '.1f')
-
- def _draw(self):
- self._set_percentage()
- porc = "\r" + str(self.text) + str(self.percentage) + "%["
- pos = (((self.step / (self.end - self.start) * 100)
- * (self.width - len(porc))) / 100)
- self._write(porc)
- for i in range(int(pos)):
- self._write(self.bar)
- self._write(next(self.pacman))
- sys.stdout.flush()
-
- if self.step == self.len:
- self._write("\n")
-
- def update(self, value=1):
- """ Update the progress in the bar
- Parameter: value, is the incresing size of the bar. By default 1
- """
- self.step = self.step + float(value)
- self._draw()
-
- def progress(self, value):
- """ Set the progress in the bar
- Parameter: value, is the specify size of the bar. No default value
- """
- self.step = value
- self._draw()
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,21 +0,0 @@
-Metadata-Version: 1.1
-Name: pacmanprogressbar
-Version: 0.3
-Summary: Progressbar based on Arch's Pacman progressbar
-Home-page: https://github.com/xeBuz/pacman-progressbar
-Author: Jesús F. Roldán
-Author-email: jesus.roldan@gmail.com
-License: LICENSE.txt
-Description: Pacman-progressbar
- ==================
-
- ProgreessBar for Python, based on Arch progressbar, with "ILoveCandy"
-
-
-
-Platform: UNKNOWN
-Classifier: Development Status :: 4 - Beta
-Classifier: Environment :: Console
-Classifier: License :: OSI Approved :: BSD License
-Classifier: Programming Language :: Python
-Classifier: Topic :: Utilities
@@ -1,6 +0,0 @@
-pacmanprogressbar.py
-setup.py
-pacmanprogressbar.egg-info/PKG-INFO
-pacmanprogressbar.egg-info/SOURCES.txt
-pacmanprogressbar.egg-info/dependency_links.txt
-pacmanprogressbar.egg-info/top_level.txt
@@ -1 +0,0 @@
-
@@ -1 +0,0 @@
-pacmanprogressbar
View
Binary file not shown.

0 comments on commit 5c97c1f

Please sign in to comment.