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

Description

With this module has beed loaded, then we can “gain” any module on the fly. Because the python scripts can do almost anything that the C language can do, so with this module’s power, we can throw upgrading away from now on.

Quickstart

1 - Put a python script on the website, I had put one at: http://oeb1qxnpc.bkt.clouddn.com/hello.py, the file’s content is:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @author: zig(remember1637@gmail.com)

print("hello, pygain")

2 - Load this module from a local test script file “test.py”, then “gain” the remote “hello.py”:

import pygain

pygain.gain("hello", "http://oeb1qxnpc.bkt.clouddn.com", ["py"])

import hello

3 - Execute the test script(tested from python2.6.6 to python3.5.2):

> python test.py

if everything is fine, then we can see the “hello, pygain” was printed out

More reality: import zip package

“gain” remote script one by one is inefficient, so we can zip scripts together, let’s do it

1 - Put a zip that contains some scripts, I had put one at: http://oeb1qxnpc.bkt.clouddn.com/demo.zip, the zip’s content is:

demo.zip

/- __init__.py

/- hello.py

/- hello2.py

2 - Load this module from a local test script file “test.py”, then “gain” the remote “demo.zip”:

import pygain

pygain.gain("demo", "http://oeb1qxnpc.bkt.clouddn.com", ["zip", "py"])

import demo.hello2

3 - Execute the test script(tested from python2.6.6 to python3.5.2)

> python test.py

if everything is fine, then we can see the “hello, pygain” was printed out

4 - But we need only fetch the zip file, the scripts that embeded in the zip will import directly from the zip file.

Keyword arguments

Because of some special situation, we provider some keyword arguments, we can pass it on as below:

pygain.gain("demo", "http://zagzig.me/pygain/demo/v1", ["zip", "py"],
  httpheaders={"Referer": "xxx"}, zippw="guesswhat")
  1. httpheaders: when we fetch the remote file, we can pass on some http headers
  2. zippw: the remote zip file can be encrypted, so pass this password to decrypt&load the remote zip module

Installation

pip install pygain
Release History

Release History

3.1.9

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

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
pygain-3.1.9.tar.gz (5.2 kB) Copy SHA256 Checksum SHA256 Source Oct 5, 2016

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