<commit_before># Copyright (c) 2012 <NAME>
# Licensed under the MIT license
# See LICENSE file for licensing details

from ui.menu_main import MainMenu
from ui.menu_acc_list import AccountListMenu
from ui.menu_acc_trans import AccountTransactionsMenu
from ui.menu_debts import DebtsListMenu
from log import *
from io import *
import data

class Ebenezer:

    def __init__(self):

        if len(data.accounts) == 0:
            self.active_account = None
        else:
            self.active_account = data.accounts[0]
        self.menus = {}
        self.menus["mainmenu"] = MainMenu(self)
        self.menus["accountlist"] = AccountListMenu(self)
        self.menus["accounttrans"] = AccountTransactionsMenu(self, self.active_account)
        self.menus["debts"] = DebtsListMenu(self, self.active_account)
        self.running = False
        self.current_menu = "mainmenu"


    def run(self):
        self.running = True
        while self.running:
            if self.active_account not in data.accounts:
                if len(accounts) == 0:
                    self.active_account = None
                else:
                    self.active_account = data.accounts[0]
            self.menus[self.current_menu].display()
        

        if data.active_file is None:
            filename = raw_input("Save in which file ? [filename] to save or [Enter] to drop changes : ")
            if filename != "":
                data.active_file = filename
        
        save(data.active_file)
        return<commit_msg>Bug fixes<commit_after># Copyright (c) 2012 <NAME>
# Licensed under the MIT license
# See LICENSE file for licensing details

from ui.menu_main import MainMenu
from ui.menu_acc_list import AccountListMenu
from ui.menu_acc_trans import AccountTransactionsMenu
from ui.menu_debts import DebtsListMenu
from log import *
from io import *
import data

class Ebenezer:

    def __init__(self):

        if len(data.accounts) == 0:
            self.active_account = None
        else:
            self.active_account = data.accounts[0]
        self.menus = {}
        self.menus["mainmenu"] = MainMenu(self)
        self.menus["accountlist"] = AccountListMenu(self)
        self.menus["accounttrans"] = AccountTransactionsMenu(self, self.active_account)
        self.menus["debts"] = DebtsListMenu(self, self.active_account)
        self.running = False
        self.current_menu = "mainmenu"


    def run(self):
        self.running = True
        while self.running:
            if self.active_account not in data.accounts:
                if len(data.accounts) == 0:
                    self.active_account = None
                else:
                    self.active_account = data.accounts[0]
            self.menus[self.current_menu].display()
        

        if data.active_file is None:
            filename = raw_input("Save in which file ? [filename] to save or [Enter] to drop changes : ")
            if filename != "":
                data.active_file = filename
                save(data.active_file)
        return
{'fraction_non_alphanumeric': 0.08754098360655738, 'fraction_numerical': 0.005245901639344262, 'mean_word_length': 2.238853503184713, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4360720', 'n_tokens_mistral': 887, 'n_tokens_neox': 843, 'n_words': 220}