def __convert(self, from_currency, to_currency, ammount): self.__currency = CurrencyManager.get_currency(from_currency) if from_currency == to_currency: result = ammount else: result = str(self.__currency.get_convertion(to_currency, ammount)) self.__master.update_result(result)
def __convert(self, from_currency, to_currency, ammount): self.initial_currency = from_currency self.initial_convertion = CurrencyManager.get_currency( self.initial_currency) result = str( self.initial_convertion.get_convertion(to_currency, ammount)) self.__master.update_result(result)
def __convert(self, from_currency, to_currency, ammount): self.__currency = CurrencyManager.get_currency(from_currency) try: result = str(self.__currency.get_convertion(to_currency, ammount)) self.__master.update_result(result) except Exception as NoneType: print('None Type error in Currency')
def menu(self): self.name_of_convertion.name = all_options option = StringVar() option.set(all_options) currency_menu = OptionMenu(self, option, *all_options) currency_menu.pack(side=left) self.__currency = CurrencyManager.get_currency(option) self.__master.__configure_UI(option)
def __convert(self, from_currency, to_currency, ammount): if from_currency == to_currency: return self.__master.update_result(ammount) try: if from_currency != self.__master.Constants.new_exchange_rate: self.__currency = CurrencyManager.get_currency( self.__master.Constants.new_exchange_rate) result = str(self.__currency.get_convertion(to_currency, ammount)) self.__master.update_result(result) except ValueError: return None
def __did_tap_convert(self, event): if self.__convert_handler is None: return try: ammount_to_convert = float(self.__currency_input.get()) except ValueError: return else: self.__currency = CurrencyManager.get_currency( self.__original_currency.get()) result = str( self.__currency.get_convertion(self.__currency_to_change.get(), ammount_to_convert)) self.update_result(result)
def __init__(self): self.__master = MainView(convert_handler=self.__convert) self.__currency = CurrencyManager.get_currency("USD")
def __convert(self, from_currency, to_currency, ammount): self.__currency = CurrencyManager.get_currency(from_currency) result = str(self.__currency.get_convertion(to_currency, ammount))
def __init__(self): self.__master = MainView(convert_handler=self.__convert) self.__currency = CurrencyManager.get_currency( self.__master.Constants.default_from_currency)
def __convert(self, from_currency, to_currency, ammount): self.__currency = CurrencyManager.get_currency( self.__master.get_from_currency()) result = str(self.__currency.get_convertion(to_currency, ammount)) self.__master.update_result(result)
def __init__(self): self.__master = MainView(convert_handler=self.__convert) self.__currency = CurrencyManager.get_currency( self.__master.Constants.exchange_rate)
def __init__(self): self.__currency = CurrencyManager.get_currency("MXN") self.__menu = self.__currency.name self.__master = MainView(convert_handler=self.__convert, menu=self.__menu)
def __get_currency(self, value): self.__currency = CurrencyManager.get_currency(value) self.__currencies = self.__currency.rates
def __init__(self): self.__currency = CurrencyManager.get_currency("USD") self.__options_menu = self.__currency.rates self.__master = MainView(convert_handler=self.__convert, options_menu=self.__options_menu)