mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
move _get_item outside of parse function
This commit is contained in:
@ -144,6 +144,13 @@ def _process(proc_data):
|
|||||||
return proc_data
|
return proc_data
|
||||||
|
|
||||||
|
|
||||||
|
def _get_item(list, index, default=None):
|
||||||
|
if index < len(list):
|
||||||
|
return list[index]
|
||||||
|
|
||||||
|
return default
|
||||||
|
|
||||||
|
|
||||||
def parse(data, raw=False, quiet=False):
|
def parse(data, raw=False, quiet=False):
|
||||||
"""
|
"""
|
||||||
Main text parsing function
|
Main text parsing function
|
||||||
@ -158,12 +165,6 @@ def parse(data, raw=False, quiet=False):
|
|||||||
|
|
||||||
Dictionary. Raw or processed structured data.
|
Dictionary. Raw or processed structured data.
|
||||||
"""
|
"""
|
||||||
def _get_item(list, index, default=None):
|
|
||||||
if index < len(list):
|
|
||||||
return list[index]
|
|
||||||
|
|
||||||
return default
|
|
||||||
|
|
||||||
jc.utils.compatibility(__name__, info.compatible, quiet)
|
jc.utils.compatibility(__name__, info.compatible, quiet)
|
||||||
jc.utils.input_type_check(data)
|
jc.utils.input_type_check(data)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user