GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — When library is using @keyword decorator to give new name for the keyword, then the method can not be called with the method name programmatically · Issue #2 · robotframework/PythonLibCore

When library is using @keyword decorator to give new name for the keyword, then the method can not be called with the method name programmatically  #2

New issue
Copy link
New issue
Copy link
Closed
Closed
When library is using @keyword decorator to give new name for the keyword, then the method can not be called with the method name programmatically #2
Copy link
Labels
bugpriority: high

Description

@aaltat
aaltat
opened on Nov 22, 2017
Issue body actions

Example if I have this code:

from robotlibcore import keyword
from robotlibcore import DynamicCore


class KwClass(object):

    @keyword('My Keyword')
    def my_kw(self):
        print 'My Kw'


class MyLibrary(DynamicCore):

    def __init__(self):
        DynamicCore.__init__(self, [KwClass()])


if __name__ == '__main__':
    x = MyLibrary()
    print x.keywords
    x.my_kw()

Then I can not call keyword with the method name my_kw and the above code raises:

{'My Keyword': <bound method KwClass.my_kw of <__main__.KwClass object at 0x059728D0>>}
Traceback (most recent call last):
  File "foo.py", line 21, in <module>
    x.my_kw()
  File "D:\workspace\SeleniumLibrary\src\SeleniumLibrary\base\robotlibcore.py", line 80, in __getattr__
    .format(type(self).__name__, name))
AttributeError: 'MyLibrary' object has no attribute 'my_kw'

Activity

  1. pekkaklarck
    changed the title [-]When library is using DynamicCore and use @keyword decorator to give new name for the keyword, then the method can not be called with the method name programmatically [/-] [+]When library is using @keyword decorator to give new name for the keyword, then the method can not be called with the method name programmatically [/+] on Nov 27, 2017
  2. pekkaklarck
    closed this as completedin 0559e5con Nov 27, 2017
  3. pekkaklarck
    added
    bug
    priority: high
    on Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority: high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.