Closed GoogleCodeExporter closed 9 years ago
We already have `Import Library` and `Import Variables` keywords so adding
`Import Resource` is logical.
Andreas, do you have time and interest to look at implementing this yourself?
The related code in robot/running/namespaces.py and robot/running/importer.py
is not too good, but you can use the existing keywords as an example. All this
code will likely be rewritten in RF 2.6 and adding this functionality after
that is probably even easier than now.
Original comment by pekka.klarck
on 28 Jun 2010 at 8:19
Import Resource
Implemented this because I needed the keyword myself. Changes made:
@/robot/running/namespaces.py:
from robot.parsing.settings import Library, Variables, Resource
def import_resource(self, name, invalid_args=None, comment=None,
variables=None):
self._import_resource(Resource(None, name, invalid_args=invalid_args, comment=comment), variables)
@/robot/libraries/BuiltIn.py:
def import_resource(self, path, *args):
NAMESPACES.current.import_resource(path.replace('/', os.sep), list(args))
I believe that was all the changes I made to make it work.
Original comment by grompy@gmail.com
on 22 Sep 2010 at 1:24
Interesting. Does this import both the keywords and the variables? We need to
test this, and add also automated tests, but if everything works nicely we
might still get this into 2.5.4.
If you grompy can create a patch against the current trunk testing this would
be easier. The changes are so small that copying them to relevant places isn't
too hard, though.
Original comment by pekka.klarck
on 22 Sep 2010 at 9:14
Original comment by jpran...@gmail.com
on 23 Sep 2010 at 12:23
Implementation in r4115 and atests r4116.
Original comment by jpran...@gmail.com
on 23 Sep 2010 at 7:03
Import Resource
Looks good otherwise but the doc should have note that this kw was added in
2.5.4.
Original comment by pekka.klarck
on 23 Sep 2010 at 7:13
Updated r4117.
Original comment by jpran...@gmail.com
on 23 Sep 2010 at 7:19
Original issue reported on code.google.com by
Andreas.EbbertKarroum@gmail.com
on 24 Jun 2010 at 1:11