def __init__(self): Application.__init__(self) self.blob_type = FileType(name = "Blob Document", suffix = "blob", #mac_creator = "BLBE", mac_type = "BLOB", # These are optional ) self.file_type = self.blob_type self.blob_cursor = Cursor("blob.tiff")
def __init__(self): Application.__init__(self) self.blob_type = FileType(name = "Blob Document", suffix = "blob", #mac_creator = "BLBE", mac_type = "BLOB", # These are optional ) self.file_type = self.blob_type self.blob_cursor = Cursor("blob.tiff")
def __init__(self, cfg): Application.__init__(self) self.cfg = cfg self.current_tab = None self.conn_history = [] self.menus = basic_menus(self.cfg.get_session_names()) self._cls_view = self._select_view_render()
def __init__(self, cfg): Application.__init__(self) self.cfg = cfg self.current_tab = None self.conn_history = [] self.menus = basic_menus(self.cfg.get_session_names()) self._cls_view = self._select_view_render()
def __init__(self): Application.__init__(self) #define a file type for the app's files #this allows us to the app to recognize the files it can open self.file_type = FileType(name='Line Document', suffix='ln') #we can create new cursors to use in our views self.line_cursor = Cursor("crosshair.tiff")
def __init__(self): Application.__init__(self) #define a file type for the app's files #this allows us to the app to recognize the files it can open self.file_type = FileType(name = 'Line Document', suffix = 'ln') #we can create new cursors to use in our views self.line_cursor = Cursor("crosshair.tiff")
def __init__(self): Application.__init__(self) self.gesture_type = FileType(name = "GestureFile", suffix = "ges", #mac_creator = "BLBE", mac_type = "BLOB", # These are optional ) self.file_type = self.gesture_type #MENUS menus = basic_menus() my_menu = Menu("Widget", [("Swizzle", 'swiz_cmd'), ("Defibrillate", 'defib_cmd')]) menus.append(my_menu) self.menus = menus
def __init__(self): Application.__init__(self)
def __init__(self): Application.__init__(self) self.file_type = FileType(name = "Blob Document", suffix = "blob")
def __init__(self): Application.__init__(self) self.pdf_type = FileType(name="PDF Document", suffix="pdf", #mac_creator = "BLBE", mac_type = "BLOB", # These are optional ) self.file_type = self.pdf_type
def __init__(self): Application.__init__(self)
def __init__(self): Application.__init__(self, title='Software de manejo de Eventos') self.event_manager_filetype = FileType(name = "Documento de Eventos",\ suffix = "event") self.file_type = self.event_manager_filetype
def __init__(self): Application.__init__(self) self.make_window()
def __init__( self ): """This is the constructor for the object.""" #call the parent constructor Application.__init__( self )
def __init__(self): Application.__init__(self) self.make_window()
def __init__(self): Application.__init__(self) self.blob_type = FileType(name = "Blob Document", suffix = "blob") self.file_type = self.blob_type self.blob_cursor = Cursor("C:\Users\m149947\Downloads\sample.tif")
def __init__(self): Application.__init__(self, title = "Log Analysis Tool") print >>sys.stderr, "app init'd" self.window = Window(size = (1200, 750), title = "Log Analysis Tool") print >>sys.stderr, "made window" # Create db cursor db = get_conn(dbname = 'reduced_log') self.cur = db.cursor() print >>sys.stderr, "made db cursor" self.current_table_suffix = None # Load the dummy image for now self.image = GraphView(size = (640, 460), position = (10, 10)) self.graph_panel = Frame() self.graph_panel.add(self.image) print >>sys.stderr, "loaded dummy image" # Declare other image lists self.full_ = None self.peruser_alltime_ = None self.peruser_divided_total_ = None self.peruser_divided_ = None # Create the display selection radio self.display_select_radiogroup = RadioGroup(action = self.change_images) height, startx = 495, 20 sp = 10 r1 = RadioButton("All users", group = self.display_select_radiogroup, value = 'all_users') r2 = RadioButton("Per user, query type", group = self.display_select_radiogroup, value = 'peruser_querytype') r3 = RadioButton("Per user, time", group = self.display_select_radiogroup, value = 'peruser_time') r4 = RadioButton("Per user, query type and time", group = self.display_select_radiogroup, value = 'peruser_querytype_time') self.graph_panel.place(r1, top = self.image + 10, left = sp) self.graph_panel.place(r2, top = self.image + 10, left = r1 + sp) self.graph_panel.place(r3, top = self.image + 10, left = r2 + sp) self.graph_panel.place(r4, top = self.image + 10, left = r3 + sp) self.window.place(self.graph_panel, top=0, left=0) self.display_select_radiogroup.value = 'all_users' # Create the top queries textbox self.topqueries = TopqueryPanel(size = (500, 460), extent = (500, 1000)) self.topqueries.panels = [[TopqueryLabel("This is a placeholder until you select a filter", ["This is where", "the values", "will go"])]] self.window.place(self.topqueries, top=10, left=680) topqueries_next_button = Button("Next", action = self.topqueries.next) topqueries_prev_button = Button("Prev", action = self.topqueries.prev) self.window.place(topqueries_next_button, left = 930, top = top - 50) self.window.place(topqueries_prev_button, left = 830, top = top - 50) print >>sys.stderr, "made top queries text box" # Declare the filter and last updated filter pointers self.fil = None self.last_used_fil = None # # ************************* # FILTER PANEL # ************************* # # **CREATE DATE PANEL** field_width = 140 self.date_panel = Frame() self.begin_date_field = TextField(size = (field_width, 30), position = (0, 5), text = DEFAULT_BEGIN_DATE_TEXT) self.end_date_field = TextField(size = (field_width, 30), position = (0, 35), text = DEFAULT_END_DATE_TEXT) self.date_panel.size = (field_width, 0) # Time division radios self.time_division_radiogroup = RadioGroup() left, right = 5, 70 row1, rowspace = 95, 25 group_by_label = Label("Group by:", position = (5, 70)) hour = RadioButton("Hour", position = (left, row1), group = self.time_division_radiogroup, value = 'hour') day = RadioButton("Day", position = (right, row1), group = self.time_division_radiogroup, value = 'day') week = RadioButton('Week', position = (left, row1 + rowspace), group = self.time_division_radiogroup, value = 'week', enabled = False) #TODO: implement 'week' in the gnuplot function month = RadioButton("Month", position = (right, row1 + rowspace), group = self.time_division_radiogroup, value = 'month') year = RadioButton("Year", position = (left, row1 + 2*rowspace), group = self.time_division_radiogroup, value = 'year') self.time_division_radiogroup.value = 'day' self.last_grouped_by = None # Add all to date panel self.date_panel.add([self.begin_date_field, self.end_date_field]) self.date_panel.add([group_by_label, hour, day, week, month, year]) self.window.place(self.date_panel, top=top, left=10) print >>sys.stderr, "made date panel" # **CREATE QUERY TYPE FILTER CHECKBOXES** x_pos = 0 y_pos = 0 y_spacing = 20 self.query_type_checkboxes = {} for qtype in querytypes: # underscores don't display properly, need an extra space after self.query_type_checkboxes[qtype] = CheckBox(qtype.replace('_', '_ '), position = (x_pos, y_pos), value = True) y_pos += y_spacing # Add the query type checkboxes and buttons to a Frame self.query_type_panel = Frame() maxw = 0 for cbox in self.query_type_checkboxes.values(): self.query_type_panel.add(cbox) maxw = max(cbox.size[0], maxw) self.query_type_panel.size = (maxw, 0) # Create all/none/invert buttons for query types buttonsize = (55, 25) self.query_type_panel.add(Button("All", action = (self.select_all, 'query_type'), size = buttonsize, position = (20, y_pos))) y_pos += 25 self.query_type_panel.add(Button("None", action = (self.deselect_all, 'query_type'), size = buttonsize, position = (20, y_pos))) y_pos += 25 self.query_type_panel.add(Button("Invert", action = (self.invert_all, 'query_type'), size = buttonsize, position = (20, y_pos))) # Add query_type_panel to the window self.window.place(self.query_type_panel, top = top, left=self.date_panel + horiz_sp) print >>sys.stderr, "made query type cboxes" # **CREATE USER AND SERVER CHECKBOX LISTS** self.user_panel = None self.server_panel = None self.create_checkbox_lists(initial=True) self.cur.execute("SELECT user, userid FROM users") self.userids = dict(self.cur.fetchall()) self.cur.execute("SELECT server, serverid FROM servers") self.serverids = dict(self.cur.fetchall()) print >>sys.stderr, "made user, server cboxes" # **CREATE QUERY SEARCH STRING PANEL** num_search_strings = 5 spacing = 30 field_width = 250 self.search_string_panel = Frame() self.search_string_panel.size = (field_width, 0) self.search_string_fields = [TextField(size = (field_width, 30), position = (0, spacing * i), text = "Query Search String {0}".format(i + 1)) for i in range(num_search_strings)] self.search_string_panel.add(self.search_string_fields) self.any_all_radiogroup = RadioGroup() any_string_radio = RadioButton("Any", position = (40, 10 + spacing * \ num_search_strings), group = self.any_all_radiogroup, value = 'any') all_strings_radio = RadioButton("All", position = (130, 10 + spacing * \ num_search_strings), group = self.any_all_radiogroup, value = 'all') no_string_radio = RadioButton("None", position = (40, 30 + spacing * \ num_search_strings), group = self.any_all_radiogroup, value = 'none') not_all_string_radio = RadioButton("Not All", position = (130, 30 + spacing * \ num_search_strings), group = self.any_all_radiogroup, value = 'not all') self.any_all_radiogroup.value = 'any' self.search_string_panel.add(any_string_radio) self.search_string_panel.add(all_strings_radio) self.search_string_panel.add(no_string_radio) self.search_string_panel.add(not_all_string_radio) self.window.place(self.search_string_panel, top = top, left = self.server_panel + 10) print >>sys.stderr, "made search string panel" # SELECT ALL/NONE, INVERT USERS # TODO: create user, server panels? atm only the cboxes are in # a ScrollableView buttonsize = (55, 25) invertbuttonsize = (60, 25) userstart = 295 serverstart = 565 self.window.place(Button("All", action = (self.select_all, 'user'), size = buttonsize), top = top + 155, left = userstart) self.window.place(Button("None", action = (self.deselect_all, 'user'), size = buttonsize), top = top + 155, left = userstart + 55 + 5) self.window.place(Button("Invert", action = (self.invert_all, 'user'), size = invertbuttonsize), top = top + 155, left = userstart + 55 + 5 + 55 + 5) # user search string textbox # TODO: the action is always one keystroke behind the text field. # This is a PyGUI 'bug',but it may only happen on windows (not sure # how the X server works). # See http://mail.python.org/pipermail/pygui/2010-November/000102.html self.user_search_string = ResponsiveTextField(emptyaction = None, action = (self.select_all_matching, 'user'), size = (180, 30), text = DEFAULT_USER_SEARCH_STRING) self.window.place(self.user_search_string, top = top + 155 + 25 + 5, left = userstart) # SELECT ALL/NONE, INVERT SERVERS self.window.place(Button("All", action = (self.select_all, 'server'), size = buttonsize), top = top + 155, left = serverstart) self.window.place(Button("None", action = (self.deselect_all, 'server'), size = buttonsize), top = top + 155, left = serverstart + 55 + 5) self.window.place(Button("Invert", action = (self.invert_all, 'server'), size = invertbuttonsize), top = top + 155, left = serverstart + 55 + 5 + 55 + 5) # server search string textbox self.server_search_string = ResponsiveTextField(emptyaction = None, action = (self.select_all_matching, 'server'), size = (180, 30), text = DEFAULT_SERVER_SEARCH_STRING) self.window.place(self.server_search_string, top = top + 155 + 25 + 5, left=serverstart) self.window.show() # **CREATE BUTTONS** self.negate = CheckBox("Negate Filter", position=(0, 0), value=False) self.refresh_button = Button("Refresh", position = (0, 25), action=self.refresh) self.update_button = Button("Update", position = (0, 60), action = self.update) # Add buttons to a panel self.button_panel = Frame() self.button_panel.add([self.negate, self.refresh_button, self.update_button]) self.window.place(self.button_panel, top = top, left=self.search_string_panel + horiz_sp) print >>sys.stderr, "made button panel"