<commit_before>#!/usr/bin/env python

import urwid
import urwid.raw_display
import urwid.web_display
from fuelmenu.common.urwidwrapper import *
from fuelmenu.common import dialog
import subprocess
import time
blank = urwid.Divider()


class saveandquit():
    def __init__(self, parent):
        self.name = "Save & Quit"
        self.priority = 99
        self.visible = True
        self.parent = parent
        self.screen = None
        #self.screen = self.screenUI()

    def save_and_exit(self, args):
        results, modulename = self.parent.global_save()
        if results:
           self.parent.footer.set_text("All changes saved successfully!")
           self.parent.refresh()
           time.sleep(1.5)
           self.parent.exit_program(None)
        else:
           #show pop up with more details
           msg = "ERROR: Module %s failed to save. Go back" % (modulename)\
                 + " and fix any mistakes or choose Exit without Saving."
           diag = dialog.display_dialog(self, TextLabel(msg),
                                        "Error saving changes!")

    def exit_without_saving(self, args):
        self.parent.exit_program(None)

    def refresh(self):
        pass<commit_msg>fix typo in refreshScreen method<commit_after>#!/usr/bin/env python

import urwid
import urwid.raw_display
import urwid.web_display
from fuelmenu.common.urwidwrapper import *
from fuelmenu.common import dialog
import subprocess
import time
blank = urwid.Divider()


class saveandquit():
    def __init__(self, parent):
        self.name = "Save & Quit"
        self.priority = 99
        self.visible = True
        self.parent = parent
        self.screen = None
        #self.screen = self.screenUI()

    def save_and_exit(self, args):
        results, modulename = self.parent.global_save()
        if results:
           self.parent.footer.set_text("All changes saved successfully!")
           self.parent.refreshScreen()
           time.sleep(1.5)
           self.parent.exit_program(None)
        else:
           #show pop up with more details
           msg = "ERROR: Module %s failed to save. Go back" % (modulename)\
                 + " and fix any mistakes or choose Exit without Saving."
           diag = dialog.display_dialog(self, TextLabel(msg),
                                        "Error saving changes!")

    def exit_without_saving(self, args):
        self.parent.exit_program(None)

    def refresh(self):
        pass
{'fraction_non_alphanumeric': 0.09153503442689348, 'fraction_numerical': 0.0032401782098015392, 'mean_word_length': 2.1953428201811125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '962979', 'n_tokens_mistral': 698, 'n_tokens_neox': 673, 'n_words': 189}