<commit_before># -*- coding:utf-8 -*-
# Copyright (c) 2012 <NAME>
# Licensed under the MIT license
# See LICENSE file for licensing details
import datetime

from ..section import EbeSection

class SubNewTransaction():

    def __init__(self, account):
        self.account = account
        now = datetime.datetime.today()
        
        self.questions = [["Transaction name ", str, "Various"],\
                          ["Transaction date  ", str, "%0#4i%0#2i%0#2i" % (now.year, now.month, now.day)],\
                          ["Transaction amount ", float, None],\
                          ["Currency symbol ", str, "€"]]

    def display(self):
        self.answers = []
        for q in self.questions:
            string = q[0]
            if q[2] is not None:
                string += "["+str(q[2])+"] "
            ans = raw_input(string)
            if ans == "" and q[2] is not None:
                ans = q[2]
            ok = False
            while not ok and q[2] is None:
                try:
                    ans = q[1](ans)
                    ok = True
                except:
                   ans = raw_input(string)
<commit_msg>Default currency for new transaction is the same as the default account currency<commit_after># -*- coding:utf-8 -*-
# Copyright (c) 2012 <NAME>
# Licensed under the MIT license
# See LICENSE file for licensing details
import datetime

from ..section import EbeSection

class SubNewTransaction():

    def __init__(self, account):
        self.account = account
        now = datetime.datetime.today()

        self.questions = [["Transaction name ", str, "Various"],\
                          ["Transaction date  ", str, "%0#4i%0#2i%0#2i" % (now.year, now.month, now.day)],\
                          ["Transaction amount ", float, None],\
                          ["Currency symbol ", str, self.account.props["currency"]]]

    def display(self):
        self.answers = []
        for q in self.questions:
            string = q[0]
            if q[2] is not None:
                string += "["+str(q[2])+"] "
            ans = raw_input(string)
            if ans == "" and q[2] is not None:
                ans = q[2]
            ok = False
            while not ok and q[2] is None:
                try:
                    ans = q[1](ans)
                    ok = True
                except:
                   ans = raw_input(string)

{'fraction_non_alphanumeric': 0.12364696086594505, 'fraction_numerical': 0.01498751040799334, 'mean_word_length': 1.505735140771637, 'pattern_counts': {'":': 0, '<': 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': '3842415', 'n_tokens_mistral': 689, 'n_tokens_neox': 646, 'n_words': 204}