Beispiel #1
0
 def editCurrency(self,  currencyid,  currencyname,  abbreviation,  symbol ):
     """Edit currency 'currencyid' providing new name, abbreviation, symbol.
     """
     currency = Currency(currencyid)
     if not currency.name :
         raise CurrencyError(
             "Can't find Currency id %r which does not exist" % currencyid )
     currency.editData( currencyname,  abbreviation,  symbol )
     self.getCurrencies()    # update currency list
     return
Beispiel #2
0
 def extract_currency(self,amount):
     #currency= accounts.rub
     #cur_index=amount.find('RUB')
     #if cur_index<0:
     ##    cur_index=amount.find('USD')
     #   currency= accounts.usd
     #    if cur_index<0:
     #        cur_index=amount.find('EUR')
     #        currency= accounts.eur
     #        if cur_index<0:
     #            cur_index=amount.find('GBR')
     #            currency= accounts.gbr
     #            if cur_index<0:
     #                cur_index=amount.find('GBP')
     #                currency= accounts.gbr
     #                if cur_index<0:
     #                    raise Exception("Unknown currency in "+amount)
     currency, cur_index=Currency.str_to_currency_code(amount)
     return currency, cur_index