Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Libraries

    entrypoint2 0.0.6

    Download button

    No screenshots available
    Downloads: 222  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    ponty | More programs
    BSD License / FREE
    May 18th, 2012, 12:11 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    entrypoint2 description

    Easy to use command-line interface for Python modules, fork of entrypoint

    entrypoint2 is an easy to use command-line interface for Python modules, a fork of entrypoint.

    Basic usage:

    Example:

    from entrypoint2 import entrypoint

    __version__ = '3.2'

    @entrypoint
    def add(one, two=4, three=False):
     ''' This function adds three numbers.

     one: first number to add
     two: second number to add
     '''


    Generated help:

    $ python -m entrypoint2.examples.hello --help
    usage: hello.py [-h] [-t TWO] [--three] [--version] [--debug] one

    This function adds two number.

    positional arguments:
     one first number to add

    optional arguments:
     -h, --help show this help message and exit
     -t TWO, --two TWO second number to add
     --three
     --version show program's version number and exit
     --debug set logging level to DEBUG


    Printing version:

    python -m entrypoint2.examples.hello --version
    3.2


    Installation:

    General

     install setuptools or pip
     install the program:

    if you have setuptools installed:

    # as root
    easy_install entrypoint2

    if you have pip installed:

    # as root
    pip install entrypoint2

    Ubuntu


    sudo apt-get install python-setuptools
    sudo easy_install entrypoint2


    Uninstall

    # as root
    pip uninstall entrypoint2


    Product's homepage

    Here are some key features of "entrypoint2":

    · function signature is preserved so it can be called both from command-line and external module
    · automatic --version flag, which prints version variable from the current module (__version__, VERSION, ..)
    · automatic --debug flag, which turns on logging
    · short flags are generated automatically (e.g. --parameter -> -p)
    · unit tests

    Requirements:

    · Python

    Limitations:

    · Python 3 is not supported
    · only @entrypoint is tested
    · @entrypoint decorator changes function name, doc; this can be resolved if necessary
    · Autocompletion is not supported

      


    TAGS:

    entrypoint fork | command-line interface | Python modules | entrypoint | fork | Python

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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