Skip to content
Commits on Apr 20, 2016
  1. Back to development: 0.17

    committed Apr 20, 2016
  2. Preparing release 0.16

    committed Apr 20, 2016
Commits on Apr 7, 2016
  1. Merge pull request #7 from glehmann/failure-check

    check the status of the command in __str__ and __iter__ and raise when the command has failed
    committed Apr 7, 2016
Commits on Apr 6, 2016
  1. @glehmann

    check the status of the command in __str__ and __iter__ and raise whe…

    …n the command has failed
    
    this avoids silent failures in code like:
    
        for commit in git("git rev-parse master..mybranch"):
            ...
    
    or
    
        content = str(git("show"))
    
    a failure - like a wrong dir, wrong branch name, ... - appears simply as an
    empty result, and thus forces to run a check before iterating over the results:
    
        gitcmd = git("git rev-parse master..mybranch")
        if gitcmd:
            # ok, we can get the result
            for gitcmd:
                ...
        else:
            # raise the error
            gitcmd >1
    
    note that it is still quite easy to ignore the failure check with __call__:
    
        for commit in git("git rev-parse master..mybranch")().splitlines():
            ...
    
        content = git("show")()
    glehmann committed Apr 6, 2016
Commits on Apr 4, 2016
  1. Merge pull request #6 from glehmann/deal-with-spaces

    dealing more gracefully with spaces
    committed Apr 4, 2016
  2. @glehmann

    dealing more gracefully with spaces

    currently with chut, we can't pass args with spaces unless shell=True is passed
    to the command:
    
        >>> python("""-c 'print "a            b"'""") >1
        ERROR:chut:File "<string>", line 1
            'print
                 ^
        SyntaxError: EOL while scanning string literal
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
          File "/Users/glehmann/Library/Python/2.7/lib/python/site-packages/chut/__init__.py", line 466, in __gt__
            return self._write(filename, 'wb+')
          File "/Users/glehmann/Library/Python/2.7/lib/python/site-packages/chut/__init__.py", line 523, in _write
            self._raise(output=output)
          File "/Users/glehmann/Library/Python/2.7/lib/python/site-packages/chut/__init__.py", line 547, in _raise
            raise OSError(self.commands_line, output.stderr)
        OSError: [Errno python -c 'print "a b"'] File "<string>", line 1
            'print
                 ^
        SyntaxError: EOL while scanning string literal
    
    passing several arguments helps - there are no exception, but the output is not
    the expected one
    
        >>> python("-c", 'print "a            b"') >1
    
        ''
    
    even with shell=True, the output is not the as expected - the number of spaces
    is not preserved:
    
        >>> python("""-c 'print "a            b"'""", shell=True) >1
        a b
        ''
    
    Now when shell=True nothing is split by chut - the shell do all the splitting
    job - and passing several args is not allowed.
    Args are split with shlex to preserve the contentinside the quotes.
    lists are allowed in the arguments and their content is passed unchanged to
    execve.
    
      echo(["a    b", "c"], "d    e")        # echo "a   b" "c" "d" "e"
      echo("a    b c d    e")                # echo "a" "b" "c" "d" "e"
      echo("'a    b' c d    e")              # echo "a    b" "c" "d" "e"
      echo("'a    b' c d    e", sh=true)     # echo "a    b" "c" "d" "e"
      echo("a    b", "c", "d    e", sh=True) # raise exception, too much args
    glehmann committed Apr 1, 2016
Commits on Mar 31, 2016
  1. Back to development: 0.16

    committed Mar 31, 2016
  2. Preparing release 0.15

    committed Mar 31, 2016
  3. Back to development: 0.15

    committed Mar 31, 2016
  4. Preparing release 0.14

    committed Mar 31, 2016
  5. Back to development: 0.14

    committed Mar 31, 2016
  6. Preparing release 0.13

    committed Mar 31, 2016
  7. Merge pull request #4 from glehmann/with-env

    temporarily change the env using a with statement
    committed Mar 31, 2016
  8. @glehmann

    temporarily change the env using a with statement

    for example:
    
        with env(LC_ALL="C"):
            do("something")
    glehmann committed Mar 31, 2016
  9. Merge pull request #3 from glehmann/with-cd

    add support for with statement to the cd method
    committed Mar 31, 2016
Commits on Mar 30, 2016
  1. @glehmann

    add support for with statement to the cd method

    this is meant to be used this way:
    
        with cd("some/place"):
          do("something")
    
    so the current dir is restored at the end of with block
    glehmann committed Mar 30, 2016
Commits on Jan 28, 2016
  1. run all tests

    committed Jan 28, 2016
  2. version

    committed Jan 28, 2016
  3. Back to development: 0.13

    committed Jan 28, 2016
  4. Preparing release 0.12

    committed Jan 28, 2016
  5. py35 support

    committed Jan 28, 2016
  6. remove 3.2; add 3.5

    committed Jan 28, 2016
  7. fix travis conf

    committed Jan 28, 2016
Commits on Jan 27, 2016
  1. take care of sub dirs

    committed Jan 27, 2016
Commits on Feb 25, 2015
  1. new binaries

    committed Feb 25, 2015
  2. add pathlib

    committed Feb 25, 2015
Commits on Feb 19, 2015
  1. examples

    committed Feb 19, 2015
  2. Back to development: 0.12

    committed Feb 19, 2015
  3. Preparing release 0.11

    committed Feb 19, 2015
Commits on Oct 9, 2014
  1. change deps

    committed Oct 9, 2014
Commits on Sep 10, 2014
  1. use netcat

    committed Sep 10, 2014
Commits on Sep 9, 2014
Commits on Aug 31, 2014
  1. add freeplayer stuff

    committed Aug 31, 2014
Commits on Jan 10, 2014
  1. improve re

    committed Jan 10, 2014
Commits on Dec 16, 2013
  1. improve serie regexp

    committed Dec 16, 2013
Something went wrong with that request. Please try again.