Skip to content

Commit

Permalink
minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Whit Morriss committed Mar 7, 2012
1 parent 401ee63 commit 6a933fe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion strap/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def __init__(self, extra_text, packages, requirements_files=[], bundle_name=None

def make_bundle_name(self, bundle_name, template="%s.strap.pybundle"):
if bundle_name:
bundle_name = bundle_name.lstrip()
if not bundle_name.endswith('pybundle'):
return template % bundle_name
return bundle_name
Expand Down Expand Up @@ -101,7 +102,6 @@ def create_bundle(self):
requirements_files = None
if self.requirements_files and not isinstance(self.requirements_files, basestring):
requirements_files = "-r %s" % " -r ".join(self.requirements_files)

arguments = dict(pip_options=self.pip_options or '',
packages=' '.join(self.packages),
requires=requirements_files or '',
Expand All @@ -113,6 +113,8 @@ def create_bundle(self):
except OSError, e:
self.logger.error("%s", e)
sys.exit(e.retcode)
if self.bundle_name.startswith('/'):
return path(self.bundle_name)
return path('.').abspath() / self.bundle_name

@staticmethod
Expand Down
6 changes: 5 additions & 1 deletion strap/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@
- clean up input options
"""
from StringIO import StringIO
import logging
import os
import subprocess
import sys


logger = logging.getLogger(__name__)


class Process(object):
"""
A slight refactoring of virtualenv.call_subprocess
"""
def __init__(self, cmd, logger, stdout=True, stdin=None,
def __init__(self, cmd, logger=logger, stdout=True, stdin=None,
filter_stdout=None, cwd=None,
raise_on_returncode=True, extra_env=None,
remove_from_env=None, return_output=False):
Expand Down
3 changes: 2 additions & 1 deletion strap/tests/test_process.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from mock import Mock
from nose.tools import raises
import unittest
from strap.tests import pushd
import logging
import unittest


class TestProcessRunner(unittest.TestCase):

Expand Down

0 comments on commit 6a933fe

Please sign in to comment.