Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • BackTrack 5 R2
  • Wine 1.4 / 1.5.5
  • Mozilla Firefox 12...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.4 LTS
  • Linux Kernel 3.4
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.4
  • Home > Linux > System > Shells

    progbar 0.3

    Download button

    No screenshots available
    Downloads: 126  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Yves-Gwenael Bourhis | More programs
    GPL / FREE
    February 18th, 2012, 18:41 GMT [view history]
    ROOT / System / Shells

     Read user reviews (0)  Refer to a friend  Subscribe

    progbar description

    Simple progression bar for shell scripts

    progbar is a simple progression bar by Yves-Gwenael Bourhis, written in Python.

    Usage:

    Class ProgBar(name, lenght):

     name is a string lenght is an integer which represents the number of elements in the bar

    Methods:

    start():

     Start the progression bar in a thread the progression and thread stop automaticaly when the "percent" property reaches 100%

    stop():

     Stop the progression bar and the thread It is recommended to call the join() method after

    fill():

     Add an element to the bar, and match the corresponding percentage

    isAlive():

     Returns True if the bar's thread is running, False otherwise

    join():

     Wait until the threaded bar terminates. It is recomended to call this method after a stop() call

    Properties:

    percent:

     percentage of the bar progression

    Example Using step progression:

    >>> def printatestbar1():
    ... bar = ProgBar('test1', 20)
    ... bar.start()
    ... while bar.isAlive():
    ... time.sleep(0.1)
    ... bar.fill()
    ... bar.join()
    ... del(bar)
    >>> printatestbar1()
    test1 [####################] 100%
    >>>


    Example Using percentage progression:

    >>> def printatestbar2():
    ... bar = ProgBar('test2', 20)
    ... bar.start()
    ... while bar.isAlive():
    ... bar.percent += 1
    ... time.sleep(0.1)
    ... bar.join()
    ... del(bar)
    >>> printatestbar2()
    test2 [####################] 100%
    >>>


    Example Interupting the progression bar:

    >>> def printatestbar3():
    ... bar = ProgBar('test3', 20)
    ... bar.start()
    ... while bar.isAlive():
    ... bar.percent += 1
    ... if bar.percent == 50:
    ... bar.stop()
    ... break
    ... time.sleep(0.1)
    ... bar.join()
    ... del(bar)
    >>> printatestbar3()
    test3 [##########- ] 50%
    >>>



    Product's homepage

    Requirements:

    · Python

    What's New in This Release: [ read full changelog ]

    · Changed author's contact info.

      


    TAGS:

    progression bar | shell scripts | progress bar | shell | progress | bar



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM