Skip to content
Snippets Groups Projects
Commit 15388c91 authored by Mehti Musayev's avatar Mehti Musayev
Browse files

Merge remote-tracking branch 'upstream/master'

# Conflicts:
#	redbaron/base_nodes.py
parents 61c9784e 782ada18
No related branches found
No related tags found
No related merge requests found
Changelog
=========
 
0.6.2 (unreleased)
0.6.3 (unreleased)
-----------------
- fix help() after append
0.6.2 (2016-10-03)
----------------
 
- add at method
Loading
Loading
Loading
Loading
@@ -64,7 +64,7 @@ Links
 
**RedBaron is fully documented, be sure to check the turorial and documentation**.
 
* [Tutorial](https://redbaron.pycqa.org/en/latest/tuto.html)
* [Documentation](https://redbaron.pycqa.org)
* [Tutorial](https://redbaron.readthedocs.io/en/latest/tuto.html)
* [Documentation](https://redbaron.readthedocs.io/en/latest/)
* [Baron](https://github.com/PyCQA/baron)
* IRC chat: [irc.freenode.net#baron](https://webchat.freenode.net/?channels=%23baron)
Loading
Loading
@@ -649,7 +649,10 @@ class Node(GenericNodesUtils):
if self.on_attribute is "root":
in_list = self.parent
elif self.on_attribute is not None:
in_list = getattr(self.parent, self.on_attribute)
if isinstance(self.parent, NodeList):
in_list = getattr(self.parent.parent, self.on_attribute)
else:
in_list = getattr(self.parent, self.on_attribute)
else:
return None
 
Loading
Loading
@@ -882,36 +885,36 @@ class Node(GenericNodesUtils):
def _get_helpers(self):
not_helpers = set([
'copy',
'decrease_indentation',
'dumps',
'edit',
'find',
'findAll',
'find_all',
'fst',
'help',
'next_generator',
'previous_generator',
'get_indentation_node',
'indentation_node_is_direct',
'parent_find',
'path',
'findAll',
'find_by_path',
'replace',
'edit',
'increase_indentation',
'decrease_indentation',
'has_render_key',
'get_absolute_bounding_box_of_attribute',
'find_by_position',
'at',
'parse_code_block',
'parse_decorators',
'from_fst',
'fst',
'generate_identifiers',
'get_absolute_bounding_box_of_attribute',
'get_indentation_node',
'has_render_key',
'help',
'increase_indentation',
'indentation_node_is_direct',
'index_on_parent',
'index_on_parent_raw',
'insert_before',
'insert_after',
'insert_before',
'next_generator',
'parent_find',
'parse_code_block',
'parse_decorators',
'path',
'previous_generator',
'replace',
'to_python',
'generate_identifiers',
])
return [x for x in dir(self) if
not x.startswith("_") and x not in not_helpers and inspect.ismethod(getattr(self, x))]
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ except ImportError:
 
 
setup(name='redbaron',
version='0.6.1',
version='0.6.2',
description='Abstraction on top of baron, a FST for python to make writing refactoring code a realistic task',
author='Laurent Peuch',
long_description=read_md("README.md") + "\n\n" + open("CHANGELOG", "r").read(),
Loading
Loading
Loading
Loading
@@ -99,11 +99,49 @@ def test_get_helpers():
assert red[0]._get_helpers() == ['modules', 'names']
 
 
def test_help_is_not_crashing():
def test_help_is_not_crashing1():
some_code = "ax + (z * 4)"
red = RedBaron(some_code)
red.help()
red[0].help()
red.help(5)
red[0].help(5)
red.help(True)
red[0].help(True)
def test_help_is_not_crashing2():
some_code = "a(b)"
red = RedBaron(some_code)
red.help()
red[0].help()
red.help(5)
red[0].help(5)
red.help(True)
red[0].help(True)
def test_help_is_not_crashing3():
some_code = "a(b, c)"
red = RedBaron(some_code)
red.help()
red[0].help()
red.help(5)
red[0].help(5)
red.help(True)
red[0].help(True)
def test_help_is_not_crashing4():
some_code = "a(b)"
red = RedBaron(some_code)
red[0].call.append("c")
red.help()
red[0].help()
red.help(5)
red[0].help(5)
red.help(True)
red[0].help(True)
 
 
def test_assign_on_string_value():
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment