Robot Framework Integrated Development Environment (RIDE)
libraryfetcher.py
Go to the documentation of this file.
1 # Copyright 2008-2015 Nokia Networks
2 # Copyright 2016- Robot Framework Foundation
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 
16 from .. import robotapi
17 from .iteminfo import LibraryKeywordInfo
18 
19 
20 def get_import_result(path, args):
21  lib = robotapi.TestLibrary(path, args)
22  kws = [
24  kw.name,
25  kw.doc,
26  lib.doc_format,
27  kw.library.name,
28  _parse_args(kw.arguments)
29  ) for kw in lib.handlers]
30  return kws
31 
32 
33 def _parse_args(args):
34  parsed = []
35  for name in args.positional:
36  parsed.append('='.join([name, str(args.defaults[name])]) if name in args.defaults else name)
37  if args.varargs:
38  parsed.append('*%s' % args.varargs)
39  for name in args.kwonlyargs:
40  parsed.append('='.join([name, str(args.defaults[name])]) if name in args.defaults else name)
41  if args.kwargs:
42  parsed.append('**%s' % args.kwargs)
43  return parsed
def get_import_result(path, args)