@@ -78,6 +78,10 @@ def setup_file_browser(self):
7878 self .file_browser .hide_columns ()
7979
8080 def setup_projects_browser (self ):
81+ """Setup the projects browser
82+
83+ Sets the model on the projects browser.
84+ """
8185 model = PugdebugProjects (self )
8286
8387 self .projects_browser .setModel (model )
@@ -108,6 +112,14 @@ def connect_file_browser_signals(self):
108112 self .file_browser .activated .connect (self .file_browser_item_activated )
109113
110114 def connect_projects_browser_signals (self ):
115+ """Connect projects browser signals
116+
117+ Connects the projects browser's activated signal to the
118+ slot that gets called when a project browser item is activated.
119+
120+ Connects the signal that gets emitted from the main window
121+ when a new project gets created.
122+ """
111123 self .projects_browser .activated .connect (
112124 self .projects_browser_item_activated
113125 )
@@ -229,6 +241,12 @@ def connect_breakpoint_viewer_signals(self):
229241 )
230242
231243 def handle_new_project_created (self , project_name ):
244+ """Handle when a new project gets created
245+
246+ Reload the projects in the projects browser.
247+
248+ Find the project that was just created and load it.
249+ """
232250 self .projects_browser .load_projects ()
233251
234252 item = self .projects_browser .model ().findItems (project_name )[0 ]
@@ -237,10 +255,19 @@ def handle_new_project_created(self, project_name):
237255 self .load_project (project )
238256
239257 def projects_browser_item_activated (self , index ):
258+ """Handle when a projects browser item gets activated
259+
260+ Find the project and load it.
261+ """
240262 project = self .projects_browser .model ().get_project_by_index (index )
241263 self .load_project (project )
242264
243265 def load_project (self , project ):
266+ """Load a project
267+
268+ Get the settings for the project and load them as the current
269+ application settings.
270+ """
244271 project_settings = project .get_settings ()
245272
246273 changed_settings = save_settings (project_settings )
@@ -745,6 +772,10 @@ def handle_expression_added_or_changed(self, index, expression):
745772 self .debugger .evaluate_expression (index , expression )
746773
747774 def handle_error (self , error ):
775+ """Handle when an error occurs
776+
777+ Show the error in an error message window.
778+ """
748779 em = QErrorMessage (self .main_window )
749780 em .showMessage (error )
750781
0 commit comments