PDA

View Full Version : Python: Moving Data Between Classes and Methods



tdrusk
July 8th, 2011, 09:51 PM
Hey guys,
First of all, I am going to go ahead and post the code:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.3 on Fri Jul 8 14:39:48 2011

import wx

# begin wxGlade: extracode
# end wxGlade


class welcome(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: welcome.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.welcome_title_text = wx.StaticText(self, -1, "Welcome to Lipsync")
self.welcome_image = wx.StaticBitmap(self, -1, wx.Bitmap("/home/tyler/Documents/School/Senior Project/wxglade/lipsyncsetup/opensource-dropbox2.png", wx.BITMAP_TYPE_ANY))
self.welcome_quit = wx.Button(self, -1, "Quit")
self.welcome_continue = wx.Button(self, -1, "Continue")

self.__set_properties()
self.__do_layout()

self.Bind(wx.EVT_BUTTON, self.btn_welcome_quit, self.welcome_quit)
self.Bind(wx.EVT_BUTTON, self.btn_welcome_continue, self.welcome_continue)
# end wxGlade

def __set_properties(self):
# begin wxGlade: welcome.__set_properties
self.SetTitle("Lipsync Setup - Welcome")
self.SetSize((480, 350))
self.welcome_title_text.SetFont(wx.Font(20, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Droid Sans"))
self.welcome_continue.SetDefault()
# end wxGlade

def __do_layout(self):
# begin wxGlade: welcome.__do_layout
welcome_sizer = wx.BoxSizer(wx.VERTICAL)
welcome_grid_sizer_main = wx.FlexGridSizer(3, 1, 0, 0)
welcome_grid_sizer_buttons = wx.FlexGridSizer(1, 2, 0, 0)
welcome_grid_sizer_main.Add(self.welcome_title_tex t, 0, wx.TOP|wx.ALIGN_CENTER_HORIZONTAL, 20)
welcome_grid_sizer_main.Add(self.welcome_image, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICA L, 0)
welcome_grid_sizer_buttons.Add(self.welcome_quit, 0, wx.ALL, 10)
welcome_grid_sizer_buttons.Add(self.welcome_contin ue, 0, wx.ALL, 10)
welcome_grid_sizer_buttons.AddGrowableCol(0)
welcome_grid_sizer_main.Add(welcome_grid_sizer_but tons, 1, wx.EXPAND, 0)
welcome_grid_sizer_main.AddGrowableRow(1)
welcome_grid_sizer_main.AddGrowableCol(0)
welcome_sizer.Add(welcome_grid_sizer_main, 1, wx.EXPAND, 0)
self.SetSizer(welcome_sizer)
self.Layout()
# end wxGlade

def btn_welcome_quit(self, event): # wxGlade: welcome.<event_handler>
#print "Event handler `btn_welcome_quit' not implemented!"
#event.Skip()
self.Show(0)
self.Close(0)

def btn_welcome_continue(self, event): # wxGlade: welcome.<event_handler>
#print "Event handler `btn_welcome_continue' not implemented!"
#event.Skip()
self.Show(0)
About.Show(1)

# end of class welcome


class about(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: about.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.about_title_text = wx.StaticText(self, -1, "About")
self.about_dialog_text = wx.StaticText(self, -1, "Lipsync is an open-source, lightweight service that provides an automated,\ntwo-way, Dropbox-styled file synchronization in Linux by utilizing OpenSSH,\nrsync, and lsyncd.", style=wx.ALIGN_CENTRE)
self.about_back_button = wx.Button(self, -1, "Back")
self.about_continue_button = wx.Button(self, -1, "Continue")

self.__set_properties()
self.__do_layout()

self.Bind(wx.EVT_BUTTON, self.btn_about_back, self.about_back_button)
self.Bind(wx.EVT_BUTTON, self.btn_about_continue, self.about_continue_button)
# end wxGlade

def __set_properties(self):
# begin wxGlade: about.__set_properties
self.SetTitle("Lipsync Setup - About")
self.SetSize((480, 350))
self.about_title_text.SetFont(wx.Font(20, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Droid Sans"))
self.about_continue_button.SetDefault()
# end wxGlade

def __do_layout(self):
# begin wxGlade: about.__do_layout
about_sizer = wx.BoxSizer(wx.VERTICAL)
about_grid_sizer_main = wx.FlexGridSizer(3, 1, 0, 0)
about_grid_sizer_buttons = wx.FlexGridSizer(1, 2, 0, 0)
about_grid_sizer_main.Add(self.about_title_text, 0, wx.TOP|wx.ALIGN_CENTER_HORIZONTAL, 20)
about_grid_sizer_main.Add(self.about_dialog_text, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICA L, 0)
about_grid_sizer_buttons.Add(self.about_back_butto n, 0, wx.ALL, 10)
about_grid_sizer_buttons.Add(self.about_continue_b utton, 0, wx.ALL, 10)
about_grid_sizer_buttons.AddGrowableCol(0)
about_grid_sizer_main.Add(about_grid_sizer_buttons , 1, wx.EXPAND, 0)
about_grid_sizer_main.AddGrowableRow(1)
about_grid_sizer_main.AddGrowableCol(0)
about_sizer.Add(about_grid_sizer_main, 1, wx.EXPAND, 0)
self.SetSizer(about_sizer)
self.Layout()
# end wxGlade

def btn_about_back(self, event): # wxGlade: about.<event_handler>
#print "Event handler `btn_about_back' not implemented!"
#event.Skip()
self.Show(0)
Welcome.Show(1)

def btn_about_continue(self, event): # wxGlade: about.<event_handler>
#print "Event handler `btn_about_continue' not implemented!"
#event.Skip()
self.Show(0)
Select_Folders.Show(1)

# end of class about

class select_folders(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: select_folders.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.select_folders_title_text = wx.StaticText(self, -1, "Select Folders")
self.select_folders_sync_from_text = wx.StaticText(self, -1, "Sync From: ")
self.select_folders_sync_from_input = wx.TextCtrl(self, -1, "")
self.select_folders_sync_to_text = wx.StaticText(self, -1, "Sync To: ")
self.select_folders_sync_to_input = wx.TextCtrl(self, -1, "")
self.select_folders_back_button = wx.Button(self, -1, "Back")
self.select_folders_continue_button = wx.Button(self, -1, "Continue")

self.__set_properties()
self.__do_layout()

self.Bind(wx.EVT_BUTTON, self.btn_select_folders_back, self.select_folders_back_button)
self.Bind(wx.EVT_BUTTON, self.btn_select_folders_continue, self.select_folders_continue_button)
# end wxGlade

def __set_properties(self):
# begin wxGlade: select_folders.__set_properties
self.SetTitle("Lipsync Setup - Select Folders")
self.SetSize((480, 350))
self.select_folders_title_text.SetFont(wx.Font(20, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Droid Sans"))
self.select_folders_sync_from_input.SetMinSize((15 0, 29))
self.select_folders_sync_to_input.SetMinSize((150, 29))
self.select_folders_continue_button.SetDefault()
# end wxGlade

def __do_layout(self):
# begin wxGlade: select_folders.__do_layout
select_folders_sizer = wx.BoxSizer(wx.VERTICAL)
select_folders_grid_sizer_main = wx.FlexGridSizer(3, 1, 0, 0)
select_folders_grid_sizer_buttons = wx.FlexGridSizer(1, 2, 0, 0)
select_folders_grid_sizer_input = wx.FlexGridSizer(2, 2, 0, 0)
select_folders_grid_sizer_main.Add(self.select_fol ders_title_text, 0, wx.TOP|wx.ALIGN_CENTER_HORIZONTAL, 20)
select_folders_grid_sizer_input.Add(self.select_fo lders_sync_from_text, 0, wx.ALIGN_CENTER_VERTICAL, 0)
select_folders_grid_sizer_input.Add(self.select_fo lders_sync_from_input, 0, 0, 0)
select_folders_grid_sizer_input.Add(self.select_fo lders_sync_to_text, 0, wx.ALIGN_CENTER_VERTICAL, 0)
select_folders_grid_sizer_input.Add(self.select_fo lders_sync_to_input, 0, 0, 0)
select_folders_grid_sizer_main.Add(select_folders_ grid_sizer_input, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICA L, 15)
select_folders_grid_sizer_buttons.Add(self.select_ folders_back_button, 0, wx.ALL, 10)
select_folders_grid_sizer_buttons.Add(self.select_ folders_continue_button, 0, wx.ALL, 10)
select_folders_grid_sizer_buttons.AddGrowableCol(0 )
select_folders_grid_sizer_main.Add(select_folders_ grid_sizer_buttons, 1, wx.EXPAND, 0)
select_folders_grid_sizer_main.AddGrowableRow(1)
select_folders_grid_sizer_main.AddGrowableCol(0)
select_folders_sizer.Add(select_folders_grid_sizer _main, 1, wx.EXPAND, 0)
self.SetSizer(select_folders_sizer)
self.Layout()
# end wxGlade

def btn_select_folders_back(self, event): # wxGlade: select_folders.<event_handler>
#print "Event handler `btn_select_folders_back' not implemented!"
#event.Skip()
self.Show(0)
Server_Credentials.Show(1)

def btn_select_folders_continue(self, event): # wxGlade: select_folders.<event_handler>
#print "Event handler `btn_select_folders_continue' not implemented!"
#event.Skip()
# save select_folders_sync_from_input to sync_from
self.Show(0)
Server_Credentials.Show(1)
# end of class select_folders

class server_credentials(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: server_credentials.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.server_credentials_title_text = wx.StaticText(self, -1, "Server Credentials")
self.server_credentials_ip_text = wx.StaticText(self, -1, "Server IP Address or Domain Name ")
self.server_credentials_ip_input = wx.TextCtrl(self, -1, "")
self.server_credentials_port_text = wx.StaticText(self, -1, "Open SSH Port on Server ", style=wx.ALIGN_RIGHT)
self.server_credentials_port_input = wx.TextCtrl(self, -1, "")
self.server_credentials_username_text = wx.StaticText(self, -1, "SSH Username on Client Server ", style=wx.ALIGN_RIGHT)
self.server_credentials_username_input = wx.TextCtrl(self, -1, "")
self.server_credentials_password_text = wx.StaticText(self, -1, "SSH Password ", style=wx.ALIGN_CENTRE)
self.server_credentials_password_input = wx.TextCtrl(self, -1, "", style=wx.TE_PASSWORD)
self.server_credentials_back_button = wx.Button(self, -1, "Back")
self.server_credentials_continue_button = wx.Button(self, -1, "Continue")

self.__set_properties()
self.__do_layout()

self.Bind(wx.EVT_BUTTON, self.btn_server_credentials_back, self.server_credentials_back_button)
self.Bind(wx.EVT_BUTTON, self.btn_server_credentials_continue, self.server_credentials_continue_button)
# end wxGlade

def __set_properties(self):
# begin wxGlade: server_credentials.__set_properties
self.SetTitle("Lipsync Setup - Server Credentials")
self.SetSize((480, 350))
self.server_credentials_title_text.SetFont(wx.Font (20, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Droid Sans"))
self.server_credentials_ip_input.SetMinSize((150, 29))
self.server_credentials_port_input.SetMinSize((150 , 29))
self.server_credentials_username_input.SetMinSize( (150, 29))
self.server_credentials_password_input.SetMinSize( (150, 29))
self.server_credentials_continue_button.SetDefault ()
# end wxGlade

def __do_layout(self):
# begin wxGlade: server_credentials.__do_layout
server_credentials_sizer = wx.BoxSizer(wx.VERTICAL)
server_credentials_grid_sizer_main = wx.FlexGridSizer(3, 1, 0, 0)
server_credentials_grid_sizer_buttons = wx.FlexGridSizer(1, 2, 0, 0)
server_credentials_grid_sizer_input = wx.FlexGridSizer(4, 2, 0, 0)
server_credentials_grid_sizer_main.Add(self.server _credentials_title_text, 0, wx.TOP|wx.ALIGN_CENTER_HORIZONTAL, 20)
server_credentials_grid_sizer_input.Add(self.serve r_credentials_ip_text, 0, wx.ALIGN_CENTER_VERTICAL, 0)
server_credentials_grid_sizer_input.Add(self.serve r_credentials_ip_input, 0, 0, 0)
server_credentials_grid_sizer_input.Add(self.serve r_credentials_port_text, 0, wx.ALIGN_CENTER_VERTICAL, 0)
server_credentials_grid_sizer_input.Add(self.serve r_credentials_port_input, 0, 0, 0)
server_credentials_grid_sizer_input.Add(self.serve r_credentials_username_text, 0, wx.ALIGN_CENTER_VERTICAL, 0)
server_credentials_grid_sizer_input.Add(self.serve r_credentials_username_input, 0, 0, 0)
server_credentials_grid_sizer_input.Add(self.serve r_credentials_password_text, 0, wx.ALIGN_CENTER_VERTICAL, 0)
server_credentials_grid_sizer_input.Add(self.serve r_credentials_password_input, 0, 0, 0)
server_credentials_grid_sizer_main.Add(server_cred entials_grid_sizer_input, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICA L, 0)
server_credentials_grid_sizer_buttons.Add(self.ser ver_credentials_back_button, 0, wx.ALL, 10)
server_credentials_grid_sizer_buttons.Add(self.ser ver_credentials_continue_button, 0, wx.ALL, 10)
server_credentials_grid_sizer_buttons.AddGrowableC ol(0)
server_credentials_grid_sizer_main.Add(server_cred entials_grid_sizer_buttons, 1, wx.EXPAND, 0)
server_credentials_grid_sizer_main.AddGrowableRow( 1)
server_credentials_grid_sizer_main.AddGrowableCol( 0)
server_credentials_sizer.Add(server_credentials_gr id_sizer_main, 1, wx.EXPAND, 0)
self.SetSizer(server_credentials_sizer)
self.Layout()
# end wxGlade

def btn_server_credentials_back(self, event): # wxGlade: server_credentials.<event_handler>
#print "Event handler `btn_server_credentials_back' not implemented!"
#event.Skip()
self.Show(0)
About.Show(1)

def btn_server_credentials_continue(self, event): # wxGlade: server_credentials.<event_handler>
#print "Event handler `btn_server_credentials_continue' not implemented!"
#event.Skip()
self.Show(0)
Verification.Show(1)

# end of class server_credentials


class verification(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: verification.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.verification_title_text = wx.StaticText(self, -1, "Verification")
self.verification_static_from_text = wx.StaticText(self, -1, "Sync From ")
self.verification_dynamic_from_text = wx.StaticText(self, -1, "label_17")
self.verification_static_to_text = wx.StaticText(self, -1, "Sync To ")
self.verification_dynamic_to_text = wx.StaticText(self, -1, "label_18")
self.verification_static_ip_text = wx.StaticText(self, -1, "Server IP/Domain ")
self.verification_dynamic_ip_text = wx.StaticText(self, -1, "label_19")
self.verification_static_port_text = wx.StaticText(self, -1, "SSH Port")
self.verification_dynamic_port_text = wx.StaticText(self, -1, "label_20")
self.verification_static_username_text = wx.StaticText(self, -1, "SSH Username")
self.verification_dynamic_username_text = wx.StaticText(self, -1, "label_21")
self.verification_static_password_text = wx.StaticText(self, -1, "SSH Password")
self.verification_dynamic_password_text = wx.StaticText(self, -1, "label_22")
self.verification_back_button = wx.Button(self, -1, "Back")
self.verification_continue_button = wx.Button(self, -1, "Continue")

self.__set_properties()
self.__do_layout()

self.Bind(wx.EVT_BUTTON, self.btn_verification_back, self.verification_back_button)
self.Bind(wx.EVT_BUTTON, self.btn_verification_continue, self.verification_continue_button)
# end wxGlade

def __set_properties(self):
# begin wxGlade: verification.__set_properties
self.SetTitle("Lipsync Setup - Verification")
self.SetSize((480, 350))
self.verification_title_text.SetFont(wx.Font(20, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Droid Sans"))
self.verification_continue_button.SetDefault()
# end wxGlade

def __do_layout(self):
# begin wxGlade: verification.__do_layout
verification_sizer = wx.BoxSizer(wx.VERTICAL)
verification_grid_sizer_main = wx.FlexGridSizer(3, 1, 0, 0)
verification_grid_sizer_buttons = wx.FlexGridSizer(1, 2, 0, 0)
verification_grid_sizer_output = wx.FlexGridSizer(6, 2, 0, 0)
verification_grid_sizer_main.Add(self.verification _title_text, 0, wx.TOP|wx.ALIGN_CENTER_HORIZONTAL, 20)
verification_grid_sizer_output.Add(self.verificati on_static_from_text, 0, wx.ALIGN_CENTER_VERTICAL, 0)
verification_grid_sizer_output.Add(self.verificati on_dynamic_from_text, 0, 0, 0)
verification_grid_sizer_output.Add(self.verificati on_static_to_text, 0, wx.ALIGN_CENTER_VERTICAL, 0)
verification_grid_sizer_output.Add(self.verificati on_dynamic_to_text, 0, 0, 0)
verification_grid_sizer_output.Add(self.verificati on_static_ip_text, 0, wx.ALIGN_CENTER_VERTICAL, 0)
verification_grid_sizer_output.Add(self.verificati on_dynamic_ip_text, 0, 0, 0)
verification_grid_sizer_output.Add(self.verificati on_static_port_text, 0, wx.ALIGN_CENTER_VERTICAL, 0)
verification_grid_sizer_output.Add(self.verificati on_dynamic_port_text, 0, 0, 0)
verification_grid_sizer_output.Add(self.verificati on_static_username_text, 0, wx.ALIGN_CENTER_VERTICAL, 0)
verification_grid_sizer_output.Add(self.verificati on_dynamic_username_text, 0, 0, 0)
verification_grid_sizer_output.Add(self.verificati on_static_password_text, 0, wx.ALIGN_CENTER_VERTICAL, 0)
verification_grid_sizer_output.Add(self.verificati on_dynamic_password_text, 0, 0, 0)
verification_grid_sizer_main.Add(verification_grid _sizer_output, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICA L, 0)
verification_grid_sizer_buttons.Add(self.verificat ion_back_button, 0, wx.ALL, 10)
verification_grid_sizer_buttons.Add(self.verificat ion_continue_button, 0, wx.ALL, 10)
verification_grid_sizer_buttons.AddGrowableCol(0)
verification_grid_sizer_main.Add(verification_grid _sizer_buttons, 1, wx.EXPAND, 0)
verification_grid_sizer_main.AddGrowableRow(1)
verification_grid_sizer_main.AddGrowableCol(0)
verification_sizer.Add(verification_grid_sizer_mai n, 1, wx.EXPAND, 0)
self.SetSizer(verification_sizer)
self.Layout()
# end wxGlade

def btn_verification_back(self, event): # wxGlade: verification.<event_handler>
#print "Event handler `btn_verification_back' not implemented!"
#event.Skip()
self.Show(0)
Server_Credentials.Show(1)

def btn_verification_continue(self, event): # wxGlade: verification.<event_handler>
#print "Event handler `btn_verification_continue' not implemented!"
#event.Skip()
self.Show(0)
Enjoy.Show(1)

# end of class verification


class enjoy(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: enjoy.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.enjoy_title_text = wx.StaticText(self, -1, "Enjoy!")
self.enjoy_dialog_text = wx.StaticText(self, -1, "Congratulations on installing Lipsync.")
self.enjoy_close_button = wx.Button(self, -1, "Close")

self.__set_properties()
self.__do_layout()

self.Bind(wx.EVT_BUTTON, self.btn_enjoy_close, self.enjoy_close_button)
# end wxGlade

def __set_properties(self):
# begin wxGlade: enjoy.__set_properties
self.SetTitle("Lipsync Setup - Enjoy!")
self.SetSize((480, 350))
self.enjoy_title_text.SetFont(wx.Font(20, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Sans"))
self.enjoy_close_button.SetDefault()
# end wxGlade

def __do_layout(self):
# begin wxGlade: enjoy.__do_layout
enjoy_sizer = wx.BoxSizer(wx.VERTICAL)
enjoy_grid_sizer_main = wx.FlexGridSizer(3, 1, 0, 0)
enjoy_grid_sizer_main.Add(self.enjoy_title_text, 0, wx.TOP|wx.ALIGN_CENTER_HORIZONTAL, 20)
enjoy_grid_sizer_main.Add(self.enjoy_dialog_text, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICA L, 0)
enjoy_grid_sizer_main.Add(self.enjoy_close_button, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 10)
enjoy_grid_sizer_main.AddGrowableRow(1)
enjoy_grid_sizer_main.AddGrowableCol(0)
enjoy_sizer.Add(enjoy_grid_sizer_main, 1, wx.EXPAND, 0)
self.SetSizer(enjoy_sizer)
self.Layout()
# end wxGlade

def btn_enjoy_close(self, event): # wxGlade: enjoy.<event_handler>
#print "Event handler `btn_enjoy_close' not implemented!"
#event.Skip()
self.Show(0)
self.Close(0)
# end of class enjoy


if __name__ == "__main__":
LipsyncSetup = wx.PySimpleApp(0)
wx.InitAllImageHandlers()
# begin lipsync setup order
Welcome = welcome(None, -1, "")
About = about(None, -1, "")
Select_Folders = select_folders(None, -1, "")
Server_Credentials = server_credentials(None, -1, "")
Verification = verification(None, -1, "")
Enjoy = enjoy(None, -1, "")
# end lipsync setup order

LipsyncSetup.SetTopWindow(Welcome)
Welcome.Show()
LipsyncSetup.MainLoop()

So, essentially I am getting data from the class select_folders through text boxes. Now, on the verification frame I need to display what I got in the input boxes. What is the best way to do this? I tried to use global variables, but it didn't work and from what I have read are frowned upon.

Thanks in advance!

Bachstelze
July 9th, 2011, 01:54 AM
This code is way too complicated (and you don't even say what the issue is). Give some smaller and clearer code to illustrate the issue at hand please.

llanitedave
July 10th, 2011, 04:32 AM
I don't see any getter or setter methods. How does the verification class know what it's looking for? It doesn't reference any of the variables that are defined in the select_folders class.

Shouldn't you use something like this:

display_data = select_folders.select_folders_sync_from_input

???

Or something similar.

tatterdemalion
July 10th, 2011, 10:53 AM
Select_Folders = select_folders(None, -1, "")

"""You should write a function which returns selected values as a dictinary
in select_folders class. In this example i assumed this function as select_folders.getValues()
"""
selected_folders = Select_Folders.getValues()
Server_Credentials = server_credentials(None, -1, "")

"""Do the same thing for server_credentials """
selected_credentials = Server_Credentials.getValues()

"""Then you can pass these dictionaries to verification class as arguments"""
Verification = verification(None, -1, "", selected_folders, selected_credentials)



I don't know much about wx but getValues() functions should look like this:



def getValues():
values = {'ssh_username':input1.value(),
'ssh_password':input2.value(),
....
....}
return values


This should work.