Re: [Sikuli-driver] [Question #240396]: need help on how to Key.DOWN in x times from a list

2013-12-17 Thread Ninja Mustang
Question #240396 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240396

Description changed to:
Hello,

How do I Key.DOWN x number of times?

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #240396]: need help on how to Key.DOWN in x times from a list

2013-12-06 Thread Ninja Mustang
Question #240396 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240396

Description changed to:
Hello,

How do I Key.DOWN x number of times?

Here is the sample script which I'm stuck in the while loop.  Thanks!

import re, os

list_serial = 
['0001-clothing-all','0001-clothing-men','0001-clothing-women','0002-clothing-all','0002-clothing-men','0002-clothing-women']
list_item = 
['111-blouses','111-dresses','111-hats','111-pants','111-shirts','111-shoes','222-blouses','222-dresses','222-hats','222-pants','222-shirts','222-shoes']

myval1 = '0002'
myval2 = '222'

myserial = []
myarrow_down_serial = []

myitem = []
myarrow_down_item = []

for line in list_serial:
p = re.compile((%s)(.*)%myval1)
m = p.search(line)
if m:
sname = m.group(1)+m.group(2)  
myserial.append(sname)
myarrow_down_serial.append(list_serial.index(sname))

for line in list_item:
p = re.compile((%s)(.*)%myval2)
m = p.search(line)

if m:
   iname = m.group(1)+m.group(2)  
   myitem.append(iname)
   myarrow_down_item.append(list_item.index(iname))

# serial_list = [1,2,3,4,5]
# item_list = [1,2,3,4,5,6,7,8,9,10]

# myserial = [3,4,5]
# myitem = [6,7,8,9,10]

i = 0
while i  len(serial_list):

# 1st run
#   serial dropdown list has [1,2,3,4,5]
type(Key.TAB)   
#   tab down 3 times, which is first value in myserial
for line in myserial:
type(Key.DOWN*line, KeyModifier.CTRL)

type(Key.TAB)   
#   item download list has [1,2,3,4,5,6,7,8,9,10]

#   tab down to 6, hold on shift and go down to 10, to select all value
in myitem

# 2nd run
#   tab down 4 times, which is 2nd value in myserial
type(Key.TAB)
#   tab down to 6, hold ctrl key, tab down to 8, so only 6 and 8 were selected 
only

# 3rd run
#   tab down 5 times, which is last vaue in myserial
#   tab down to 9, hold shift select 9, 10

i += 1

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #240396]: need help on how to Key.DOWN in x times from a list

2013-12-06 Thread Ninja Mustang
Question #240396 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240396

Description changed to:
Hello,

How do I Key.DOWN x number of times?

Here is the sample script which I'm stuck in the while loop.  Thanks!

import re, os

list_serial = 
['0001-clothing-all','0001-clothing-men','0001-clothing-women','0002-clothing-all','0002-clothing-men','0002-clothing-women']
list_item = 
['111-blouses','111-dresses','111-hats','111-pants','111-shirts','111-shoes','222-blouses','222-dresses','222-hats','222-pants','222-shirts','222-shoes']

myval1 = '0002'
myval2 = '222'

myserial = []
myarrow_down_serial = []

myitem = []
myarrow_down_item = []

for line in list_serial:
p = re.compile((%s)(.*)%myval1)
m = p.search(line)
if m:
sname = m.group(1)+m.group(2)  
myserial.append(sname)
myarrow_down_serial.append(list_serial.index(sname))

for line in list_item:
p = re.compile((%s)(.*)%myval2)
m = p.search(line)

if m:
   iname = m.group(1)+m.group(2)  
   myitem.append(iname)
   myarrow_down_item.append(list_item.index(iname))

# serial_list = [1,2,3,4,5]
# item_list = [1,2,3,4,5,6,7,8,9,10]

# myserial = [3,4,5]
# myitem = [6,7,8,9,10]

i = 0
while i  len(serial_list):

# 1st run
#   serial dropdown list has [1,2,3,4,5,6,7]
type(Key.TAB)   
#   tab down 3 times, which is first value in myserial
for line in myserial:
type(Key.DOWN*line, KeyModifier.CTRL)

type(Key.TAB)   
#   item download list has [1,2,3,4,5,6,7,8,9,10,11,12]

#   tab down to 6, hold on shift and go down to 10, to select all value
in myitem

# 2nd run
#   tab down 4 times, which is 2nd value in myserial
type(Key.TAB)
#   tab down to 6, hold ctrl key, tab down to 8, so only 6 and 8 were selected 
only

# 3rd run
#   tab down 5 times, which is last vaue in myserial
#   tab down to 9, hold shift select 9, 10, 11

i += 1

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #240396]: need help on how to Key.DOWN in x times from a list

2013-12-06 Thread RaiMan
Question #240396 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240396

Status: Open = Answered

RaiMan proposed the following answer:
  for line in myserial:
   type(Key.DOWN*line, KeyModifier.CTRL)

--- Key.DOWN*line
this is not a valid parameter for type()

if you want to repeat keys with type(), you have to repeat the type():

  for line in myserial:
   for nline in range(line): type(Key.DOWN, KeyModifier.CTRL)

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #240396]: need help on how to Key.DOWN in x times from a list

2013-12-06 Thread Ninja Mustang
Question #240396 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240396

Description changed to:
Hello,

How do I Key.DOWN x number of times?

Here is the sample script which I'm stuck in the while loop.  Thanks!

import re, os

list_serial = 
['0001-clothing-all','0001-clothing-men','0001-clothing-women','0002-clothing-all','0002-clothing-men','0002-clothing-women']
list_item = 
['111-blouses','111-dresses','111-hats','111-pants','111-shirts','111-shoes','222-blouses','222-dresses','222-hats','222-pants','222-shirts','222-shoes']

myval1 = '0002'
myval2 = '222'

myserial = []
myarrow_down_serial = []

myitem = []
myarrow_down_item = []

for line in list_serial:
p = re.compile((%s)(.*)%myval1)
m = p.search(line)
if m:
sname = m.group(1)+m.group(2)  
myserial.append(sname)
myarrow_down_serial.append(list_serial.index(sname))

for line in list_item:
p = re.compile((%s)(.*)%myval2)
m = p.search(line)

if m:
   iname = m.group(1)+m.group(2)  
   myitem.append(iname)
   myarrow_down_item.append(list_item.index(iname))


#['0002-clothing-all', '0002-clothing-men', '0002-clothing-women']
print myserial

#[3, 4, 5]
print myarrow_down_serial

#['222-blouses', '222-dresses', '222-hats', '222-pants', '222-shirts', 
'222-shoes']
print myitem

#[6, 7, 8, 9, 10, 11]
print myarrow_down_item

#comparelist = [x for x in list_serial if x in myserial]
#print comparelist

i = 0
while i  len(myserial):
# 1st run
#   serial dropdown list has [1,2,3,4,5]
type(Key.TAB)   
#   tab down 3 times, which is first value in myserial
for line in myserial:
   for nline in range(line): 
   #type(Key.DOWN, KeyModifier.CTRL)
   print nline


#type(Key.TAB)   
#   item dropdown list has [1,2,3,4,5,6,7,8,9,10]
#   tab down to 6, hold on shift and go down to 10, to select all value in 
myitem

# 2nd run
#   tab down 4 times, which is 2nd value in myserial
#type(Key.TAB)
#   tab down to 6, hold ctrl key, tab down to 8, so only 6 and 8 were selected 
only

# 3rd run
#   tab down 5 times, which is last vaue in myserial
#   tab down to 9, hold shift select 9, 10

i += 1

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #240396]: need help on how to Key.DOWN in x times from a list

2013-12-06 Thread Ninja Mustang
Question #240396 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240396

Status: Answered = Open

Ninja Mustang is still having a problem:
i got an error

for nline in range(line):
TypeError: range() integer end argument expected, got str.

also, i think i'm missing something since myserial list has 3,4,5 and
the serial_list has 0,1,2,3,4,5.  I need to key.DOWN 3 times to get to 3
and not sure what am I missing.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #240396]: need help on how to Key.DOWN in x times from a list

2013-12-06 Thread Ninja Mustang
Question #240396 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240396

Status: Open = Solved

Ninja Mustang confirmed that the question is solved:
i got it, i indexed it so it worked.

only thing is when the list is large, it has to compare and take long
time, i had to put wait(1) in between otherwise it just crashed.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp