← Back to team overview

sikuli-driver team mailing list archive

[Bug 1317813] Re: Clipboard issues, old data isnt cleared

 

I tried it. This is the result

My code:

    # -*- coding: utf-8 -*-
    import locale <-- tried without this as well
    locale.setlocale(locale.LC_ALL, '') <-- tried without this as well

    def tripleClick(PSMRL):
        hover(PSMRL)
        for x in xrange(3):
            mouseDown(Button.LEFT)
            mouseUp()
    
    tripleClick("1399632526648.png")
    
    type("c", KEY_CTRL)
    testString = Env.getClipboard().encode('utf-8').strip()
    popup(str(testString))

String:  
    ÅÄÖåäö with UTF-8 encoding
    ÅÄÖåäö with ISO encoding

If there is a simpler way to do this I'm all ears. :) Im just new to
Java and Python

** Attachment added: "iso vs utf.png"
   https://bugs.launchpad.net/sikuli/+bug/1317813/+attachment/4108573/+files/iso%20vs%20utf.png

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1317813

Title:
  Clipboard issues, old data isnt cleared

Status in Sikuli:
  In Progress

Bug description:
  Hi.

  I ran across an issue (it occurs in about 1 out of 30 trials) where
  old data gets passed from the clipboard to the paste function.

  Code:
          tripleClick(Pattern("1392988992662.png").targetOffset(70,2))
          type("c", KEY_CTRL)
          adress = Env.getClipboard().encode('iso-8859-15').strip()

  and paste part... about 350 SLOC later:
          paste(u"V\xC4GD 1")

  For some reason it picks a random object from the clipboard (and
  sometimes its not even the last copied item either...)

  And why am I doin it this way? Well, its because special characters
  (like ÅÄÖ) arent very popular and cant be written using the type()
  function. But paste(u"") works.

  Is this a problem in SikuliX or the Clipboard or somewhere else?

  Machine = Win7 Pro SP1

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1317813/+subscriptions


References