forked from not-kennethreitz/envoy
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kenneth Reitz
committed
Aug 27, 2011
1 parent
a9682e7
commit 0b8b22a
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from core import * |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
envoy.core | ||
~~~~~~~~~~ | ||
This module provides | ||
""" | ||
|
||
import subprocess | ||
import shlex | ||
|
||
|
||
class Response(object): | ||
"""A command's response""" | ||
|
||
def __init__(self): | ||
super(Response, self).__init__() | ||
self.command = None | ||
|
||
def __repr__(self): | ||
return '<Respones [{0}]>'.format(self.command) | ||
|
||
@property | ||
def status_code(self): | ||
return 0 | ||
|
||
@property | ||
def std_out(self): | ||
return '' | ||
|
||
@property | ||
def std_err(self): | ||
return '' | ||
|
||
|
||
def run(command, data=None, timeout=None): | ||
"""Executes a given commmand and returns Response. | ||
Blocks until process is complete, or timeout is reached. | ||
""" | ||
|
||
return Response() |