Skip to content


some PEP 8 love needed #307

wants to merge 2 commits into from

2 participants

Fabric member


running the pep8 tool shows this:

sa@sub:~/0/python/fabric/fabric$ alias acsn; acsn pep8; pep8 *py
alias acsn='apt-cache search --names-only'
pep8 - Python PEP 8 code style checker E302 expected 2 blank lines, found 1 E501 line too long (97 characters) E225 missing whitespace around operator E202 whitespace before ')' E261 at least two spaces before inline comment E303 too many blank lines (3) W291 trailing whitespace E301 expected 1 blank line, found 0 E231 missing whitespace after ',' W602 deprecated form of raising exception

We should probably update requirements.txt and to include pep8 and have a task for running it automatically on every commit. For more info on pep8:

Originally submitted by Markus Gattol (markusgattol) on 2011-03-09 at 04:08am EST

Closed as Done on 2011-04-21 at 08:45pm EDT

@bitprophet bitprophet was assigned
Fabric member

Rick Harding (mitechie) posted:

I've pushed a branch in my github fork that pep8's the codebase and the test files:

There was discussion of getting pep8 checks into the Hudson/Jenkins build server. Since there's not a straight pep8 violations plugin you need to cheat a bit.

Ticket mentioning desire to get a pep8 plugin constructed

Blog post showing perl regex used to format pep8 to match voilations plugin for pylint

on 2011-03-13 at 11:06pm EDT

Fabric member

Morgan Goose (goosemo) posted:

Attached the notes you put in here, rick, onto #87. And pulled in what'd you'd done already to my 1.1 branch. Will need to work out a way to keep this up to snuff.

on 2011-04-05 at 01:41pm EDT

Fabric member

Rick Harding (mitechie) posted:

Applied in changeset commit:422268b3d938ba3eb71fdacae12b209584a5f0dc.

on 2011-04-21 at 08:45pm EDT

@bitprophet bitprophet closed this
@ramonvanalteren ramonvanalteren pushed a commit to ramonvanalteren/fabric that referenced this pull request
@bitprophet bitprophet Add changelog entry re #307 33cc7e2

Sorry, swapped issue number (want to attach to #370, not 307 :-( )

@richid richid pushed a commit to richid/fabric that referenced this pull request
@mitechie mitechie Fixes #307 Update code to match Pep8 standards
- I've updated most of the code to match PEP8. There are a few valid exceptions
left behind
- Note, stripping trailing whitespace from "expecting" strings in will break tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 20, 2011
  1. @GaretJax

    Fix put operation to consider remote cwd as set by the context manage…

    GaretJax committed
    …r when the remote_path argument is empty.
  2. @GaretJax

    Consider local path as set by lcd context manager when using put with…

    GaretJax committed
    … an empty local_path argument.
Showing with 4 additions and 3 deletions.
  1. +4 −3 fabric/
7 fabric/
@@ -386,7 +386,7 @@ def put(local_path=None, remote_path=None, use_sudo=False,
also exhibits the ``.failed`` and ``.succeeded`` attributes.
# Handle empty local path
- local_path = local_path or os.getcwd()
+ local_path = local_path or env.lcwd or os.getcwd()
# Test whether local_path is a path or a file-like object
local_is_path = not (hasattr(local_path, 'read') \
@@ -397,8 +397,9 @@ def put(local_path=None, remote_path=None, use_sudo=False,
with closing(ftp) as ftp:
home = ftp.normalize('.')
- # Empty remote path implies cwd
- remote_path = remote_path or home
+ # Empty remote path implies cwd as set by cd context manager
+ # If not set fall back to home directory
+ remote_path = remote_path or env.get('cwd') or home
# Expand tildes
if remote_path.startswith('~'):
Something went wrong with that request. Please try again.