[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [ooni-probe/master] Directly map process stdout and stderr to stdout and sterr fds
commit ab46fd21aa14be2904ebb37162edc3bcfc8eb2d4
Author: Arturo Filastò <art@xxxxxxxxx>
Date: Thu Nov 13 13:34:52 2014 +0100
Directly map process stdout and stderr to stdout and sterr fds
---
ooni/resources/__init__.py | 3 +--
ooni/resources/cli.py | 3 ---
setup.py | 7 ++-----
3 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/ooni/resources/__init__.py b/ooni/resources/__init__.py
index d0f0cb9..71e0a95 100644
--- a/ooni/resources/__init__.py
+++ b/ooni/resources/__init__.py
@@ -1,11 +1,10 @@
-import os
-
from ooni.settings import config
from ooni.utils import unzip, gunzip
from ooni.deckgen.processors import citizenlab_test_lists
from ooni.deckgen.processors import namebench_dns_servers
+config.initialize_ooni_home()
config.read_config_file()
__version__ = "0.0.1"
diff --git a/ooni/resources/cli.py b/ooni/resources/cli.py
index b836b18..cab9700 100644
--- a/ooni/resources/cli.py
+++ b/ooni/resources/cli.py
@@ -3,7 +3,6 @@ import sys
from twisted.internet import defer
from twisted.python import usage
-from ooni.settings import config
from ooni.utils import log
from ooni.resources import __version__
@@ -39,8 +38,6 @@ def run():
print options
sys.exit(1)
- config.initialize_ooni_home()
- config.read_config_file()
if options['update-inputs']:
print "Downloading inputs"
try:
diff --git a/setup.py b/setup.py
index 7b46764..bd9255e 100644
--- a/setup.py
+++ b/setup.py
@@ -149,8 +149,5 @@ setup(
from subprocess import Popen, PIPE
process = Popen(['ooniresources', '--update-inputs', '--update-geoip'],
- stdout=PIPE, stderr=PIPE)
-while process.poll() is None:
- out = process.stdout.read()
- sys.stdout.write(out)
- sys.stdout.flush()
+ stdout=sys.stdout.fileno(), stderr=sys.stderr.fileno())
+process.wait()
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits