Re: 10 sec poll - please reply!

2012-11-29 Thread Michael Herrmann
Hey everyone, this is my final mail. With all your help we have decided on names for our function. It was a surprisingly difficult process but your inputs helped tremendously. I have described our experiences (very good ones here, but somewhat mixed ones with StackOverflow) in a blog entry:

Re: 10 sec poll - please reply!

2012-11-25 Thread ALeX inSide
press_keys() On Tuesday, November 20, 2012 2:18:38 PM UTC+2, Michael Herrmann wrote: Hi, I'm developing a GUI Automation library (http://www.getautoma.com) and am having difficulty picking a name for the function that simulates key strokes. I currently have it as 'type' but that

Re: 10 sec poll - please reply!

2012-11-25 Thread Michael Herrmann
On Sunday, November 25, 2012 12:23:13 AM UTC+1, Dennis Lee Bieber wrote: ... Pardon? In ASCII (and encodings that share the first 128 positions), a TAB is x09. def show(c): ... print %r is 0x%2.2X % (c, ord(c)) ... show(raw_input()[0]) i 'i' is 0x69

Re: 10 sec poll - please reply!

2012-11-25 Thread Michael Herrmann
On Sunday, November 25, 2012 4:56:49 AM UTC+1, Steven D'Aprano wrote: Michael, please trim your replies. There is no need to quote nearly 200 lines of previous emails that you don't make direct reference to in your response. We prefer inline quoting here (where you interleave quoted text

Re: 10 sec poll - please reply!

2012-11-24 Thread Michael Herrmann
Hi Steven, press('s') is allowed. So is press('S') - it presses shift for you and is thus equivalent to press(SHIFT + 's'). You can write press('f', 's'). You cannot write press('fs') because that's what enter(...) is for. If you try - or, as I would deem more likely, happen do to it by

Re: 10 sec poll - please reply!

2012-11-24 Thread Michael Herrmann
Thanks for your reply Dennis, the commands sounding like they should be commands to a user is the whole point of the exercise: In doing so, we hope to make the API accessible also to users from a less technical background. You are perfectly right that system events are being generated and

Re: 10 sec poll - please reply!

2012-11-24 Thread Michael Herrmann
Hey, how about 'write' instead of 'enter'? write(Hello World!) write(Brick Lane, into=Street) This avoids the ambiguity of whether 'enter' ends by pressing ENTER or not. Thanks, Michael On Tuesday, November 20, 2012 1:18:38 PM UTC+1, Michael Herrmann wrote: Hi, I'm

Re: 10 sec poll - please reply!

2012-11-23 Thread Michael Herrmann
Dear all, the emails are getting kind of long so to ask you briefly: What do you think of splitting `type` into two functions `press` and `enter`? Their use cases are: press(CTRL + 'a') press(ENTER) press(ALT + 'f', 's') enter(Hello World!)

Re: 10 sec poll - please reply!

2012-11-23 Thread Michael Herrmann
Hi again, Steven's points and the feeling for `type` are very good and maybe the problems I mentioned can be ramified. I therefore opened a new thread to find out what the general public thinks about overwriting built-in functions such as `type` here:

Re: 10 sec poll - please reply!

2012-11-23 Thread Kwpolska
On Fri, Nov 23, 2012 at 2:42 PM, Michael Herrmann michael.herrm...@getautoma.com wrote: Dear all, the emails are getting kind of long so to ask you briefly: What do you think of splitting `type` into two functions `press` and `enter`? Their use cases are: press(CTRL + 'a')

Re: 10 sec poll - please reply!

2012-11-23 Thread Michael Herrmann
Hi, I see your concern with having two functions that have to be separately remembered... I personally would also be fine with type(), however some people are violently against it. I opened a new thread (https://groups.google.com/forum/?fromgroups=#!topic/comp.lang.python/GjZ2hAS1Wyk) to ask

Re: 10 sec poll - please reply!

2012-11-23 Thread Steven D'Aprano
On Fri, 23 Nov 2012 05:42:22 -0800, Michael Herrmann wrote: Dear all, the emails are getting kind of long so to ask you briefly: What do you think of splitting `type` into two functions `press` and `enter`? This invites confusion as to the rules of when you can call `press` and when you

Re: 10 sec poll - please reply!

2012-11-22 Thread Michael Herrmann
Dear all, thank you for your replies. After experimenting with your suggestions, we have arrived at a solution that we believe fits well with our existing API. However, before we implement this solution, we would like to ask you one last time to sign off on our proposal or raise any serious

Re: 10 sec poll - please reply!

2012-11-22 Thread Chris Angelico
On Fri, Nov 23, 2012 at 5:00 AM, Michael Herrmann michael.herrm...@getautoma.com wrote: In our gut feeling, the words apart from `type` that would most normally be used in an everyday conversation to express the three examples I have given in my first mail are: press(CTRL + 'a')

Re: 10 sec poll - please reply!

2012-11-22 Thread Michael Herrmann
Hi, thanks for your prompt reply; I agree that there is also this ambiguity. This would go away if we were to use `type` but as I said we don't dare to do that. That's the problem with short names - they're always ambiguous at least to some extent. The only alleviation I can offer for the

Re: 10 sec poll - please reply!

2012-11-22 Thread Steven D'Aprano
On Thu, 22 Nov 2012 10:00:54 -0800, Michael Herrmann wrote: We took the fact that naming our one function 'type' was so difficult to name as an indicator that it may be trying to do too many things: I don't think it is difficult to name at all. On the one hand, it allows you to enter plain

Re: 10 sec poll - please reply!

2012-11-21 Thread markus . moldaschl
Am Dienstag, 20. November 2012 13:18:38 UTC+1 schrieb Michael Herrmann: Hi, I'm developing a GUI Automation library (http://www.getautoma.com) and am having difficulty picking a name for the function that simulates key strokes. I currently have it as 'type' but that clashes with the

Re: 10 sec poll - please reply!

2012-11-21 Thread Hans Mulder
On 21/11/12 02:17:26, Steven D'Aprano wrote: On Tue, 20 Nov 2012 18:00:59 -0600, Tim Chase wrote: On 11/20/12 06:18, Michael Herrmann wrote: am having difficulty picking a name for the function that simulates key strokes. I currently have it as 'type' but that clashes with the built-in

Re: 10 sec poll - please reply!

2012-11-21 Thread Michael Herrmann
Dear all, thanks so much for your replies. Based on your inputs, we have started to experiment with changes to our API. I hope to be able to present the results to you tomorrow. Thanks again, Michael On Tuesday, November 20, 2012 1:18:38 PM UTC+1, Michael Herrmann wrote: Hi, I'm

Re: 10 sec poll - please reply!

2012-11-21 Thread Andrew Cooper
On 21/11/2012 07:01, Steven D'Aprano wrote: On Wed, 21 Nov 2012 17:35:27 +1100, Chris Angelico wrote: And yet, trivial though it may seem, function naming in a permanent API is pretty important. Threads like this can be the difference between coherent and useful APIs and veritable piles of

Re: 10 sec poll - please reply!

2012-11-20 Thread Chris Angelico
On Tue, Nov 20, 2012 at 11:18 PM, Michael Herrmann michael.herrm...@getautoma.com wrote: Hi, I'm developing a GUI Automation library (http://www.getautoma.com) and am having difficulty picking a name for the function that simulates key strokes. I currently have it as 'type' but that clashes

Re: 10 sec poll - please reply!

2012-11-20 Thread Steven D'Aprano
You know, you would probably get more responses if you picked a descriptive subject line that didn't look like spam. I only read your post because I accidentally clicked on it. On Tue, 20 Nov 2012 04:18:38 -0800, Michael Herrmann wrote: I'm developing a GUI Automation library

Re: 10 sec poll - please reply!

2012-11-20 Thread Michael Herrmann
Hi, thank you for your replies. So far two people said 'send_keys' and one person said 'type'. Steven, thanks for your reply. Sorry if the message title disturbed you. My personal feelings aren't too strongly against 'type' either, but then I'm afraid it might bother more experienced Python

Re: 10 sec poll - please reply!

2012-11-20 Thread Michael Herrmann
P.S.: The website is back online; our hosting provider was having technical problems... On Tuesday, November 20, 2012 1:18:38 PM UTC+1, Michael Herrmann wrote: Hi, I'm developing a GUI Automation library (http://www.getautoma.com) and am having difficulty picking a name for the

Re: 10 sec poll - please reply!

2012-11-20 Thread Dave Angel
On 11/20/2012 07:18 AM, Michael Herrmann wrote: Hi, I'm developing a GUI Automation library (http://www.getautoma.com) and am having difficulty picking a name for the function that simulates key strokes. I currently have it as 'type' but that clashes with the built-in function. Example

Re: 10 sec poll - please reply!

2012-11-20 Thread Neil Cerutti
On 2012-11-20, Dave Angel da...@dejaviewphoto.com wrote: I also vote for send_keys(), even before I saw Chris' reply. 'type' is too overloaded a word. For example, in Windows, it's the command to display the contents of a file - it types it to the screen. type is a nice verb, but since it's

Re: 10 sec poll - please reply!

2012-11-20 Thread Michael Herrmann
Thanks again for your further replies. So far, it's 4 votes for 'send_keys' and 1 vote for 'type'. Regarding 'send_keys': To me personally it makes sense to send keys _to_ something. However, in our API, send_keys would not be called on an object or with a parameter indicating the target. It

Re: 10 sec poll - please reply!

2012-11-20 Thread MRAB
On 2012-11-20 15:18, Michael Herrmann wrote: Thanks again for your further replies. So far, it's 4 votes for 'send_keys' and 1 vote for 'type'. Regarding 'send_keys': To me personally it makes sense to send keys _to_ something. However, in our API, send_keys would not be called on an object

Re: 10 sec poll - please reply!

2012-11-20 Thread John Gordon
In 3d71f175-164e-494c-a521-2eaa5679b...@googlegroups.com Michael Herrmann michael.herrm...@getautoma.com writes: What, in your view, would be the most intuitive alternative name? keyboard_input(). -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com

Re: 10 sec poll - please reply!

2012-11-20 Thread Dave Angel
On 11/20/2012 11:09 AM, John Gordon wrote: In 3d71f175-164e-494c-a521-2eaa5679b...@googlegroups.com Michael Herrmann michael.herrm...@getautoma.com writes: What, in your view, would be the most intuitive alternative name? keyboard_input(). Well, since Python already has input() and

Re: 10 sec poll - please reply!

2012-11-20 Thread emile
On 11/20/2012 04:18 AM, Michael Herrmann wrote: Hi, I'm developing a GUI Automation library (http://www.getautoma.com) and am having difficulty picking a name for the function that simulates key strokes. I currently have it as 'type' but that clashes with the built-in function. Example uses

Re: 10 sec poll - please reply!

2012-11-20 Thread Mark Lawrence
On 20/11/2012 15:18, Michael Herrmann wrote: Thanks again for your further replies. So far, it's 4 votes for 'send_keys' and 1 vote for 'type'. Regarding 'send_keys': To me personally it makes sense to send keys _to_ something. However, in our API, send_keys would not be called on an object

Re: 10 sec poll - please reply!

2012-11-20 Thread Steven D'Aprano
On Tue, 20 Nov 2012 07:18:42 -0800, Michael Herrmann wrote: Thanks again for your further replies. So far, it's 4 votes for 'send_keys' and 1 vote for 'type'. Regarding 'send_keys': To me personally it makes sense to send keys _to_ something. However, in our API, send_keys would not be

Re: 10 sec poll - please reply!

2012-11-20 Thread mherrmann . at
That's a very good suggestion Emile!! So I might eventually need both 'press' and 'release' (or press_key/release_key). Thanks for this! To everyone else who has been so kind to reply thus far: What do you think of generate_keystrokes? It's a bit long but describes exactly what the function

Re: 10 sec poll - please reply!

2012-11-20 Thread Joshua Landau
On 20 November 2012 16:19, Dave Angel d...@davea.name wrote: On 11/20/2012 11:09 AM, John Gordon wrote: In 3d71f175-164e-494c-a521-2eaa5679b...@googlegroups.com Michael Herrmann michael.herrm...@getautoma.com writes: What, in your view, would be the most intuitive alternative name?

Re: 10 sec poll - please reply!

2012-11-20 Thread Chris Angelico
On Wed, Nov 21, 2012 at 3:21 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Tue, 20 Nov 2012 07:18:42 -0800, Michael Herrmann wrote: Thanks again for your further replies. So far, it's 4 votes for 'send_keys' and 1 vote for 'type'. Regarding 'send_keys': To me personally

Re: 10 sec poll - please reply!

2012-11-20 Thread xDog Walker
On Tuesday 2012 November 20 08:29, mherrmann...@gmail.com wrote: To everyone else who has been so kind to reply thus far: What do you think of generate_keystrokes? It's a bit long but describes exactly what the function would be doing. If not already offered and rejected, how about enter() ?

RE: 10 sec poll - please reply!

2012-11-20 Thread Prasad, Ramit
Steven D'Aprano wrote: On Tue, 20 Nov 2012 07:18:42 -0800, Michael Herrmann wrote: Thanks again for your further replies. So far, it's 4 votes for 'send_keys' and 1 vote for 'type'. Regarding 'send_keys': To me personally it makes sense to send keys _to_ something. However, in our

Re: 10 sec poll - please reply!

2012-11-20 Thread Alan Meyer
On 11/20/2012 11:29 AM, mherrmann...@gmail.com wrote: ... generate_keystrokes? ... Not bad. gen_keystrokes, or even keystrokes might also do. I suggest using a name that is unique enough that you can grep through piles of code and find where it's used. type fails that test.

Re: 10 sec poll - please reply!

2012-11-20 Thread Tim Chase
On 11/20/12 06:18, Michael Herrmann wrote: am having difficulty picking a name for the function that simulates key strokes. I currently have it as 'type' but that clashes with the built-in function. Just to add one more to the pot, Vim uses feedkeys() for a similar purpose. -tkc --

Re: 10 sec poll - please reply!

2012-11-20 Thread Steven D'Aprano
On Tue, 20 Nov 2012 18:00:59 -0600, Tim Chase wrote: On 11/20/12 06:18, Michael Herrmann wrote: am having difficulty picking a name for the function that simulates key strokes. I currently have it as 'type' but that clashes with the built-in function. Just to add one more to the pot, Vim

Re: 10 sec poll - please reply!

2012-11-20 Thread Steven D'Aprano
On Tue, 20 Nov 2012 21:08:24 +, Prasad, Ramit wrote: I believe that your initial instinct for the name of this function was correct. It automates typing, so you should call it type or (for those paranoid about shadowing the built-in, type_str. I can too easily see somebody doing from

Re: 10 sec poll - please reply!

2012-11-20 Thread Tim Chase
On 11/20/12 19:17, Steven D'Aprano wrote: On Tue, 20 Nov 2012 18:00:59 -0600, Tim Chase wrote: Just to add one more to the pot, Vim uses feedkeys() for a similar purpose. What does it feed to the keys? In Vim's case, the signature would be something like def feedkeys(str, mode='m'):

Re: 10 sec poll - please reply!

2012-11-20 Thread Tim Chase
On 11/20/12 19:20, Steven D'Aprano wrote: *Accidental* shadowing of names is a bad thing, because you get unexpected bugs. *Deliberate* shadowing is not. We're all consenting adults here, if somebody calls from module import type, and shadows the builtin type, that's their right to shoot

Re: Re: 10 sec poll - please reply!

2012-11-20 Thread Evan Driscoll
On 11/20/2012 05:46 PM, Alan Meyer wrote: On 11/20/2012 11:29 AM, mherrmann...@gmail.com wrote: ... generate_keystrokes? ... Not bad. gen_keystrokes, or even keystrokes might also do. I would emphatically vote no for keystrokes. That's a noun, not a verb. What does it do? Tell you if its

Re: 10 sec poll - please reply!

2012-11-20 Thread Alan Bawden
Since the event being generated is commonly called a keystroke, and since my dictionary defines the noun stroke as being: the act of striking, a good verb to choose for the action itself would seem to be strike: strike('a') -- http://mail.python.org/mailman/listinfo/python-list

Re: 10 sec poll - please reply!

2012-11-20 Thread Chris Angelico
On Wed, Nov 21, 2012 at 4:25 PM, rh richard_hubb...@lavabit.com wrote: To counter your question. 10 sec. poll for the name for the law that states that people will discuss/argue the most over those things having little or no significance. You mean bikeshedding? Parkinson's Law of

Re: 10 sec poll - please reply!

2012-11-20 Thread Steven D'Aprano
On Wed, 21 Nov 2012 17:35:27 +1100, Chris Angelico wrote: And yet, trivial though it may seem, function naming in a permanent API is pretty important. Threads like this can be the difference between coherent and useful APIs and veritable piles of excrement. There are only two hard problems