forked from srund/outils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathotools
51 lines (41 loc) · 975 Bytes
/
otools
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 8 22:39:22 2022
Main entry-point for otools from a shell
@author: Simon Rundstedt
"""
#%%
import os
import click
import cli
#%%
@click.command()
@click.option("-f","--fullpath",help="Print full path of found modules", is_flag=True, default=False)
def listmodules(**kwargs):
mhandle = ot.base.OdooToolsHandle()
result = ot.modules.listmodules(mhandle)
if not kwargs["fullpath"]:
result = [ os.basename(r) for r in result]
result.sort()
for r in result:
click.echo(r)
#%%
@click.command()
@click.option("--hello-world/--no-hello-world", default=False) # - is _ in key
def main(**kwargs):
'''
Parameters
----------
**kwargs : dict
keyword arguments
Returns
-------
None.
'''
if kwargs.get("hello_world") :
click.echo("Hello World!")
#%%
if __name__ == "__main__":
cli.client.main()
#listmodules()