Skip to content

BuiltIn: New Reload Library keyword #293

Closed
Closed

Description

@spooning

Originally submitted to Google Code by @jrantanen on 19 Apr 2009

Currently it is not possible to import library multiple times with
different arguments using WITH NAME. Current implementation needs
refactoring to support reimports.

Activity

  1. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @jrantanen on 23 Feb 2010

    Currently reimporting is done in RemoteApplications by handling RF internals. It
    would be great if we can publish this interface already in 2.1.3 release.

  2. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @jrantanen on 1 Mar 2010

    There are multiple ways to solve this issue. Let's design this properly on 2.5.

  3. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @khusa on 20 Apr 2010

    Descoped from 2.5.

  4. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 27 Apr 2011

    Initially scoped for 2.6 release.

  5. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @yanne on 3 May 2011

    Initially descoped from 2.6 and moved to 2.7.

  6. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @spooning on 2 Dec 2011

    Initially descoped from 2.7 due to lack of time

  7. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 20 Oct 2013

    Issue 1546 has been merged into this issue.

  8. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 15 May 2014

    The original description is misleading because at least nowadays it is possible to import same library multiple times with different arguments and use WITH NAME syntax to assign different names for them. The attached examples shows how this works in practice. The example uses Import Library keyword but using Library setting works exactly same way.

    It is still problem in some use cases that an imported library cannot change what keywords it implements.

  9. edbrannin commented on Sep 30, 2014

    @edbrannin
    Contributor

    For posterity, here are the code samples from the original issue:

    dynkws.py

    class dynkws:
    
        def __init__(self, *kws):
            self.kws = kws
    
        def get_keyword_names(self):
            return self.kws
    
        def __getattr__(self, name):
            if name not in self.kws:
                raise AttributeError
            return self.keyword
    
        def keyword(self, arg):
            print arg.upper()

    dynkws.robot

    *** Test Cases ***
    x
        Import Library    dynkws.py    Foo    WITH NAME    FooLib
        Import Library    dynkws.py    Bar    WITH NAME    BarLib
        Foo    arg
        Bar    another
    
  10. changed the title [-]Reimporting Library[/-] [+]Support reloading library[/+] on Nov 10, 2014
  11. added this to the 2.9 milestone on Nov 10, 2014
  12. pekkaklarck commented on Nov 10, 2014

    @pekkaklarck
    Member

    Issue MarketSquare/remoteswinglibrary#2 demonstrates why an API to reload libraries is needed. Let's finally implement this in RF 2.9.

  13. jussimalinen commented on Jun 4, 2015

    @jussimalinen
    Member

    There at least two different levels of reloading/reimporting.

    One way of doing this is that the robot requests the implemented keywords again from the library, and updates the namespace. This would still keep the very same library instance in use. We can call this reloading.

    Another one would be to do a full reimport, where the robot will create a new object instance from the library. I dont know if robot should then even recheck the library scope. This could then be called reimporting.

    RemoteSwingLibrary would require the first kind of reloading and I think it should be enough for most cases. Therefore for now this issue will be about reloading a library and if necessary we can later create a separate issue about reimporting.

  14. changed the title [-]Support reloading library[/-] [+]BuiltIn: New `Reload Library` keyword[/+] on Jul 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions