qitaos / robotframework-autoitlibrary

Automatically exported from code.google.com/p/robotframework-autoitlibrary
Apache License 2.0
11 stars 14 forks source link

AttributeError:'module' object has no attribute 'Empty' #22

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.import AutoItLibrary in my remote library MyRemote.py
2.python MyRemote.py
3.pybot remote_tests.txt

What is the expected output? What do you see instead?
expected output: run test case remote_tests.txt normally
actual output: AttributeError:'module' object has no attribute 'Empty'

What version of the product are you using? On what operating system?
AutoItLibrary 1.1 
Robot Framework 
Python 2.7.3
pywin32-217 2.7.1
Windows 7

Please provide any additional information below.
1 When I just import AutoItLibrary in python interactive mode, every thing is 
okay.
2 When I modify the file F8937E53-D444-4E71-9275-35B64210CC3Bx0x1x0.py which 
locates under win32com/gen_py, change "pythoncom.Empty" to "" like below
#defaultNamedOptArg=pythoncom.Empty
#defaultNamedNotOptArg=pythoncom.Empty
#defaultUnnamedArg=pythoncom.Empty
defaultNamedOptArg=""
defaultNamedNotOptArg=""
defaultUnnamedArg=""

It got work, but I don't get the root cause.

MyRemote.py
import os
import sys
from AutoItLibrary import *
class MyRemote():
    def __init__(self):
        print "init"

    def my_keyword(self):
                print "my keyword"
if __name__ == '__main__':
    from robotremoteserver import RobotRemoteServer
    RobotRemoteServer(MyRemote(), *sys.argv[1:])

Original issue reported on code.google.com by kyooky12...@gmail.com on 6 Jun 2012 at 2:28

GoogleCodeExporter commented 9 years ago
The version of Robot Framework is 2.7.1(64)

Original comment by kyooky12...@gmail.com on 6 Jun 2012 at 2:30

GoogleCodeExporter commented 9 years ago
MyRemote.py
import os
import sys
from AutoItLibrary import *
class MyRemote():
    def __init__(self):
        print "init"

    def my_keyword(self):
                print "my keyword"
                AutoItLibrary().Run("calc") #here must invoke some API in AutoItLibrary, or there will be no problem
if __name__ == '__main__':
    from robotremoteserver import RobotRemoteServer
    RobotRemoteServer(MyRemote(), *sys.argv[1:])

Original comment by kyooky12...@gmail.com on 6 Jun 2012 at 2:36