Skip to main content

module for add function in terminal

Project description

Module myterm
=============

Installation
------------

::

pip install myterm

Or

::

git clone https://github.com/fraoustin/myterm.git
cd myterm
python setup.py install


Usage
-----

If you want add color in python command, add you pythonstartup env

::

import myterm.startup

Or

::

export PYTHONSTARTUP=/usr/local/lib/python2.7/dist-packages/myterm/startup.py

If you want color in console program

::

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import logging
import logging.handlers
import myterm

VERSION="0.1"
PROG="test1"
DESCRIPTION="""test of myterm.StreamHandler"""
AUTHOR="Author"

if __name__ == '__main__':
usage = "usage: %prog [options]"
parser = myterm.OptionParser(version="%s %s" % (PROG,VERSION), usage=usage)
parser.description= DESCRIPTION
parser.epilog = AUTHOR
try:
(options, args) = parser.parse_args()
# create logger
logger = logging.getLogger("simple_example")
logger.setLevel(logging.DEBUG)
# create console handler and set level to debug
ch = myterm.StreamHandler()
ch.setLevel(logging.DEBUG)
# create formatter
formatter = logging.Formatter("%(icon)s %(asctime)s - %(name)s - %(levelname)s - %(message)s")
# add formatter to ch
ch.setFormatter(formatter)
# add ch to logger
logger.addHandler(ch)

# "application" code
logger.debug("debug message")
logger.info("info message")
logger.warn("warn message")
logger.error("error message")
logger.critical("critical message")

except Exception as e:
parser.error(e)
sys.exit(1)


0.3.0
=====

* support of virtualenv in startup
* manage color

0.2.9
=====

* hotfix for color default on unix


0.2.8
=====

* add util
* add in parser -v

0.2.7
=====

* add config

0.2.6
=====

* add table

0.2.5
=====

* manage log

0.2.4
=====

* manage log

0.2.3
=====

* manage log

0.2.2
=====

* correction color default

0.2.1
=====

* correction stdinfo

0.2.0
=====

* rebuild all functionality
* del pipadd, ...

0.1.4
=====

* add multi template

0.1.3
=====

* add .gitignore in template
* add argument --create-directory

0.1.2
=====

* add piptest
* correction of pipclean

0.1.0
=====

* version majeur

0.0.10
=======

* add pipclean
* correction pylint (note > 8/10)
* add in template tests and test pylint

0.0.9
=====

* in pipadd del parameter project, use argument, add module et project in template

0.0.8
=====

* bug singleton log
* add exception ConfError

0.0.7
=====

* manage no Terminal()

0.0.6
=====

* Change parameter for myterm.log.Logger.add_rotating_file
* add myterm.log.Logger.LEVELLOG

0.0.5
=====

Add:

* manage template file python (*.py_t) in pipadd
* color of prompt is YELLOW
* conf_dir return path, file and conf

0.0.4
=====

Add:

* pipadd
* correction of requirements with colorconsole


0.0.3
=====

change README.rst

Add:

* Logger
* find_confdir

0.0.2
=====

Initialize project

Add:

* startup with color
* StreamHandler with color
* OptionParser with color

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
myterm-0.3.0.zip (28.1 kB) Copy SHA256 hash SHA256 Source None Oct 5, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page