mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
compatibility function call
This commit is contained in:
16
jc/jc.py
16
jc/jc.py
@ -68,12 +68,26 @@ def helptext(message):
|
||||
|
||||
Example:
|
||||
ls -al | jc --ls -p
|
||||
|
||||
'''
|
||||
|
||||
print(textwrap.dedent(helptext_string), file=sys.stderr)
|
||||
|
||||
|
||||
def errormessage(message):
|
||||
error_string = f'''
|
||||
jc: {message}
|
||||
'''
|
||||
|
||||
print(textwrap.dedent(error_string), file=sys.stderr)
|
||||
|
||||
|
||||
def compatibility(mod_name, compatible):
|
||||
if sys.platform not in compatible:
|
||||
mod = mod_name.split('.')[-1]
|
||||
errormessage(f'{mod} parser not compatible with your OS ({sys.platform}).\n Compatible platforms: {compatible}')
|
||||
exit()
|
||||
|
||||
|
||||
def main():
|
||||
signal.signal(signal.SIGINT, ctrlc)
|
||||
|
||||
|
@ -79,6 +79,7 @@ $ lsblk | jc --lsblk -p
|
||||
]
|
||||
"""
|
||||
import string
|
||||
import jc
|
||||
|
||||
|
||||
def process(proc_data):
|
||||
@ -129,6 +130,9 @@ def process(proc_data):
|
||||
|
||||
|
||||
def parse(data, raw=False):
|
||||
jc.jc.compatibility(__name__,
|
||||
['linux'])
|
||||
|
||||
raw_output = []
|
||||
linedata = data.splitlines()
|
||||
# Clear any blank lines
|
||||
|
Reference in New Issue
Block a user