Home Download Buy Blog Forum Support

Getting User Data

Getting User Data

Postby jacobm001 on Tue Sep 10, 2013 11:31 pm

Getting user input in a function:

I'm writing a plugin that works with a users instance of a web application called stikked. I'm having a hard time getting input from the user.

I have

Code: Select all
if args['reply'] == 'true':
         reply = self.view.window().show_input_panel("Reply to:", "", self.user_input, None, None)
         print reply.get_text()
         data = urllib.urlencode( {"title":self.cur_file(), "text":text, "name":author, "lang":self.cur_syntax(), "private":private, "reply":reply } )

and the function:

Code: Select all
   def user_input(self, input):
      print "input: " + input
      return input

Unfortunately I can't seem to figure out how to get the text the user inputted into the same function in which it was called. Any ideas?
Posts: 1
Joined: Tue Sep 10, 2013 9:18 pm

Re: Getting User Data

Postby skuroda on Wed Sep 11, 2013 2:53 am

The on_done parameter (self.user_input in your case) is a callback. Move your urllib.urlencode call to that method.
Posts: 692
Joined: Fri Oct 05, 2012 8:11 am

Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 5 guests