Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Conversation

@sandlbn
Copy link

@sandlbn sandlbn commented Mar 30, 2014

When gdb is not installed pyringe returns unclear message. Gdb is not installed by default in MacOS 10.9 .

@sandlbn
Copy link
Author

sandlbn commented Mar 31, 2014

I apologize for this amount of commits and small question, why indentations are incompatible with the pep8 ?

@vinitkumar
Copy link

Google uses different indentation than pep8. You might want to check Google Python Style Guide here http://google-styleguide.googlecode.com/svn/trunk/pyguide.html

If you use Vim, you might want to use this setting:\

" Indent Python in the Google way.

setlocal indentexpr=GetGooglePythonIndent(v:lnum)

let s:maxoff = 50 " maximum number of lines to look backwards.

function GetGooglePythonIndent(lnum)

  " Indent inside parens.
  " Align with the open paren unless it is at the end of the line.
  " E.g.
  "   open_paren_not_at_EOL(100,
  "                         (200,
  "                          300),
  "                         400)
  "   open_paren_at_EOL(
  "       100, 200, 300, 400)
  call cursor(a:lnum, 1)
  let [par_line, par_col] = searchpairpos('(\|{\|\[', '', ')\|}\|\]', 'bW',
        \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
        \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
        \ . " =~ '\\(Comment\\|String\\)$'")
  if par_line > 0
    call cursor(par_line, 1)
    if par_col != col("$") - 1
      return par_col
    endif
  endif

  " Delegate the rest to the original function.
  return GetPythonIndent(a:lnum)

endfunction

let pyindent_nested_paren="&sw*2"
let pyindent_open_paren="&sw*2"

@sandlbn
Copy link
Author

sandlbn commented Mar 31, 2014

@vinitkumar
Copy link

@sandlbn Yes, what I pasted was content of that file ;)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is only used once in __init__ (as soon as we know it's installed, we don't have to check anymore), I propose inlining this in the form of

executable_name = _GDB_ARGS[0]
if not distutils.spawn.find_executable(executable_name):
  raise OSError('executable could not be found, is gdb installed?')

(Also, a gentle reminder towards CONTRIBUTING.md. As this project is owned by Google, you'll have to sign a CLA before we can accept pull requests.)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TehMillhouse Hi CLA signed I will try to push refactored code tomorrow.

@jack17529
Copy link

jack17529 commented Apr 5, 2017

Anybody working? Or should I take it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants