This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This is a very thin layer on top of stdlib’s subprocess module. It is simply for some convenient functions that are needed in many of my projects.

Full documentation could come later but if you really want something that makes using subprocess much easier I would personally try envoy. However, at this time envoy seemed a bit too early in it’s development to use so I created my own very thin layer to satisfy my needs for the time being.

If you’d like something with higher aspirations please check out envoy.

Examples

Simple example:

import subwrap

response = subwrap.run(['echo', 'hello'])

# Display hello
print response.std_out

By default subwrap throws a CommandError if the command being run exits with an exit code that is not zero. To catch default command errors:

import subwrap

try:
    response = subwrap.run(['false'])
except subwrap.CommandError, e:
    #this is the response, you can do what you want here
    response = e.response

However that’s not always useful. You can have subwrap run your own custom exit handle for each subprocess. Just do the following:

import subwrap

def my_exit_handle(response):
    if response.return_code == 0:
        print "HAPPY DAY!"
    else:
        print "Not as happy"

# The next line will output "Not as happy" to stdout
response = subwrap.run(['false'], exit_handle=my_exit_handle)

License

MIT License

Release History

Release History

0.1.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
subwrap-0.1.0.tar.gz (3.3 kB) Copy SHA256 Checksum SHA256 Source Mar 28, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting