This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(raxcli)[rranjan@localhost python-raxcli]$ python setup.py install | |
running install | |
running bdist_egg | |
running egg_info | |
writing requirements to raxcli.egg-info/requires.txt | |
writing raxcli.egg-info/PKG-INFO | |
writing top-level names to raxcli.egg-info/top_level.txt | |
writing dependency_links to raxcli.egg-info/dependency_links.txt | |
writing entry points to raxcli.egg-info/entry_points.txt | |
reading manifest file 'raxcli.egg-info/SOURCES.txt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(libREST)[rranjan@localhost libcloud.rest]$ python libcloud_rest/server.py | |
Traceback (most recent call last): | |
File "libcloud_rest/server.py", line 101, in <module> | |
main() | |
File "libcloud_rest/server.py", line 97, in main | |
logger=logger, debug=options.debug) | |
File "libcloud_rest/server.py", line 19, in start_server | |
from libcloud_rest.application import LibcloudRestApp | |
File "/home/rranjan/.virtualenvs/libREST/lib/python2.7/site-packages/libcloud_rest-0.0.1-py2.7.egg/libcloud_rest/application.py", line 7, in <module> | |
from libcloud_rest.api.urls import urls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Jc2k> does parinx cache anything? the thought of constantly parsing docstrings in an app isnt a pleasant one. | |
* rocker has quit (Ping timeout: 246 seconds) | |
<rahulrrixe> Jc2k : I didn't notice the message early :( | |
<Jc2k> its ok :) | |
<rahulrrixe> Jc2k : no there is no caching in parinx | |
<rahulrrixe> can you suggest me how can i implement this feature | |
<Jc2k> rahulrrixe: perhaps if you had a Parser class so that the API looked like this: | |
<Jc2k> from parinx.parser import Parser | |
<Jc2k> parser = Parser() | |
<Jc2k> p.get_method_docstring(a_method) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<rahulrrixe> Jc2k : I have one question \0/ | |
<rahulrrixe> I am trying to build a repl for apache libcloud so that a user can execute the libcloud code online | |
<rahulrrixe> but these code will be executed on server so security is important thing | |
<Jc2k> Daemoen: it was added to pycrypto git in Feb 2011 | |
<rahulrrixe> so what should i use pysandbox or restricted python for safe execution? | |
<Jc2k> Daemoen: looks like it was first in pycrypto 2.5 | |
<Daemoen> Jc2k: yeah... found that python-crypto on el6 is *wayyyyy* behind | |
<Daemoen> 2.0.1 | |
<Jc2k> Daemoen: welcome to el6 :) | |
<Jc2k> you are probably going to have to put evverrything in virtualenv to have a chance with that thing.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
One option might be to use PyPy to create a sandboxed python. It would limit the external operations someone could do. | |
Once you have that set up, your website would take the code source, send it over ajax to your webserver, and the server would run the code in a subprocess of a sandboxed python instance. You would also be able to kill the process if it took longer than say 5 seconds. Then you return the output back as a response to the client. | |
See these links for help on a PyPy sandbox: | |
http://doc.pypy.org/en/latest/sandbox.html | |
http://readevalprint.com/blog/python-sandbox-with-pypy.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5139 pts/0 T 0:00 sudo docker search ubuntu | |
5140 pts/0 Tl 0:00 docker search ubuntu | |
5312 pts/0 S 0:00 sudo HTTP_PROXY=http://172.31.1.4:8080/ docker -d | |
5316 pts/0 Sl 0:00 docker -d | |
6801 pts/0 S+ 0:00 grep --color=auto docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import click | |
@click.group() | |
@click.pass_context | |
def cli(ctx): | |
pass | |
@cli.command() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import click | |
@click.group() | |
@click.pass_context | |
def cli(ctx): | |
pass | |
@cli.command(cls=click.Group) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rahulrrixe> rest if we compare cliff and click, then click is better | |
<rahulrrixe> as use of decorator make it very suitable for CLI which we want to developemnt | |
<rahulrrixe> **develop | |
<rahulrrixe> in our case we need to have config file parser and click handles that very well and .ini is custom to it | |
<rahulrrixe> also it support context | |
<rahulrrixe> i don't know much about it but what i have understood through documentation is that like we have <api><resource><action> | |
<rahulrrixe> resource is child for api and if we want to pass the information of api we can do through context | |
<rahulrrixe> it is useful because we want if a user had made connection then it should be stored in object | |
* rdodev (~rdodev@2001:4802:7801:103:18ba:c153:ff20:563f) has joined #libcloud | |
<rahulrrixe> not every request makes a new connection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Cliff sample app | |
~~~~~~~~~~~~~~~~ | |
""" | |
import os | |
import sys | |
import logging |
OlderNewer