Skip to content

Commit 036d249

Browse files
committed
adding links to help and new way to call help
1 parent e4eb3fb commit 036d249

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

geosupport/function_info.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def function_help(function):
8585
function = FUNCTIONS[function]
8686

8787
s = [
88+
"",
8889
"%s (%s)" % (function['function'], ', '.join(function['alt_names'])),
8990
"="*40,
9091
function['description'],
@@ -94,13 +95,21 @@ def function_help(function):
9495
"Modes: %s" % ', '.join([
9596
m for m in MODES if function[m] is not None
9697
]),
97-
"",
98-
"Inputs",
98+
"\nInputs",
9999
"="*40,
100+
"\n".join([
101+
"%s - %s" % (i['name'], i['comment']) for i in function['inputs']
102+
]),
103+
"\nReference",
104+
"="*40,
105+
function['links'],
106+
""
100107
]
101108

102-
for i in function['inputs']:
103-
s.append("%s - %s" % (i['name'], i['comment']))
109+
#for i in function['inputs']:
110+
# s.append("%s - %s" % (i['name'], i['comment']))
111+
112+
#s.append()
104113

105114
s = "\n".join(s)
106115

geosupport/geosupport.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def call(self, kwargs_dict={}, mode=None, **kwargs):
8383
def __getattr__(self, name):
8484
if name in FUNCTIONS:
8585
p = partial(self.call, function=name)
86+
p.help = partial(function_help, name)
8687
return p
8788

8889
raise AttributeError("'%s' object has no attribute '%s'" %(

0 commit comments

Comments
 (0)