'Function called when the user press the refresh button.
Gets an updated copy of the workspaces and checks against
the model to see which are already there and which arent'

def refresh_sidebar(self, button=None):

    self.workspaces = self.serverIO.get_workspaces_names()
    model = self.workspace_model
    added_workspaces = [added_ws[0] for added_ws in model]
    for ws in self.workspaces:
        if (ws not in added_workspaces):
            ws_iter = self.workspace_model.append([ws])
            self.valid_ws_iters.append(ws_iter)
    for ws in added_workspaces:
        if (ws not in self.workspaces):
            iter = self.get_iter_by_name(ws)
            self.workspace_model.remove(iter)
