Skip to content

Commit

Permalink
|\ merge from release-0.1.2, released as 0.1.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
StyXman committed Sep 11, 2013
2 parents 5324b65 + 1a6713f commit 32d33f6
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
__pycache__
build
Attic
dist
MANIFEST
14 changes: 0 additions & 14 deletions ChangeLog

This file was deleted.

20 changes: 20 additions & 0 deletions ChangeLog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ayrton (0.1.2) unstable; urgency=low

* RunninCommand.exit_code is a property, not a function. Closes #13.

-- Marcos Dione <[email protected]> Wed, 11 Sep 2013 19:38:12 +0200

ayrton (0.1.1) unstable; urgency=low

* The remote code (the body of a `with ssh (..): ...`) can be either pure
Python or ayrton. Pure Python imposes less dependencies on the remote.
* You can access the original `argv` in the remote.
* More documentation, more examples, even some that are useful!

-- Marcos Dione <[email protected]> Wed, 11 Sep 2013 08:53:04 +0200

ayrton (0.1) unstable; urgency=low

* Initial release.

-- Marcos Dione <[email protected]> Sun, 09 Sep 2013 12:45:42 +0200
4 changes: 2 additions & 2 deletions ayrton/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from ast import fix_missing_locations, Import, alias
import pickle

__version__= '0.1.1'
__version__= '0.1.2'

class RunningCommandWrapper (sh.RunningCommand):
def _handle_exit_code (self, code):
Expand All @@ -38,7 +38,7 @@ def _handle_exit_code (self, code):

def __bool__ (self):
# in shells, a command is true if its return code was 0
return self.exit_code ()==0
return self.exit_code==0

# monkey patch sh
sh.RunningCommand= RunningCommandWrapper
Expand Down
9 changes: 7 additions & 2 deletions ayrton/tests/test_ayrton.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,13 @@ def testStdEqCapture (self):
# ANS: because echo adds the first one and print adds the second one
self.assertEqual (self.a.buffer.getvalue (), b'echo: foo\n\n')

def testExitCode (self):
ayrton.main ('')
def testExitCodeOK (self):
ayrton.main ('if true (): print ("yes!")')
self.assertEqual (self.a.buffer.getvalue (), b'yes!\n')

def testExitCodeNOK (self):
ayrton.main ('if not false (): print ("yes!")')
self.assertEqual (self.a.buffer.getvalue (), b'yes!\n')

class MiscTests (unittest.TestCase):
setUp= setUpMockStdout
Expand Down
1 change: 0 additions & 1 deletion doc/examples/with_ssh.ay
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import random

supercalifragilisticexpialidocious= 'Supercalifragilisticexpialidocious'
a= 42

with ssh ('localhost', allow_agent=False) as s:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Functions
Changes the current working directory for the script process. If used as a
context manager, it restores the original path when the context finishes,
efectively working more or less like *pushd*/*popd* or ``( cd path; ... ).
efectively working more or less like `pushd`/`popd` or `( cd path; ... )`.

.. py:function:: export (key=value, ...)
Expand Down

0 comments on commit 32d33f6

Please sign in to comment.