Giter Site home page Giter Site logo

Comments (4)

yuanchun-li avatar yuanchun-li commented on July 24, 2024

random.choice() doesn't accept set-type parameter.
Convert it to list type should solve this issue.

from droidbot.

hannoL avatar hannoL commented on July 24, 2024

Now with 866657a I have a new error Message: IndexError: list index out of range

hanno@dockerDroidBox:~/work/PycharmProjects/gsoc_droidbot$ python start.py -d emulator-5554 -a ~/mobileSamples/myApkTresor/0xA1EA512A.apk -env static -event static -o ~/mobileSamples/out/
Connecting to a device with serialno=emulator-5554 with a timeout of 60 secs...
Connected to device with serialno=emulator-5554
Actual device serialno=emulator-5554
INFO:TelnetConsole:telnet successfully initiated, the addr is (localhost:5554)
INFO:AppEnvManager:start deploying environment, policy is static
INFO:AppEnvManager:finish deploying environment, policy is static
INFO:AppEventManager:start sending events, policy is static
INFO:Device:sending event: {'y': 578.6571309256251, 'x': 7.700258676474885, 'event_type': 'touch'}
INFO:Device:sending event: {'y': 302.5150305392291, 'x': 269.4077683002539, 'event_type': 'touch'}
Traceback (most recent call last):
  File "start.py", line 59, in <module>
    main()
  File "start.py", line 54, in main
    droidbot.start()
  File "/home/hanno/work/PycharmProjects/gsoc_droidbot/droidbot/droidbot.py", line 61, in start
    event_manager.start()
  File "/home/hanno/work/PycharmProjects/gsoc_droidbot/droidbot/app_event.py", line 599, in start
    self.event_factory.start(self)
  File "/home/hanno/work/PycharmProjects/gsoc_droidbot/droidbot/app_event.py", line 625, in start
    event = self.generate_event()
  File "/home/hanno/work/PycharmProjects/gsoc_droidbot/droidbot/app_event.py", line 690, in generate_event
    event = IntentEvent(random.choice(list(self.possible_broadcasts)))
  File "/usr/lib/python2.7/random.py", line 273, in choice
    return seq[int(self.random() * len(seq))]  # raises IndexError if seq is empty
IndexError: list index out of range

from droidbot.

yuanchun-li avatar yuanchun-li commented on July 24, 2024

Added non-empty check before each random.choice().

from droidbot.

hannoL avatar hannoL commented on July 24, 2024

Thank You. That works fine with d19fb0f.

from droidbot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.