1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #-------------------------------------------------------------------------------
- # library to read winmentor paradox database
- #-------------------------------------------------------------------------------
- # from winmentor.dbread import WinMentor
- from .dbread import WinMentor
- # from winmentor.info_anaf import check_list, file_start
- from .info_anaf import check_list, file_open
- # from winmentor.mentorutils import Mentorutils
- from .mentorutils import Mentorutils
- # from winmentor.__init__ import count_down
- from ._invoice import Invoice, InvoiceDetails, HtmlEnvelope
- from .tax_mailer import M_mailer
- from .taxes import Taxes
- from .smslink import Smslink
- import time
- import operator
- # 'CHRYSOPEEA BRANDING & DESIGN S.R.L.': {'mail': ['cristina.stan@chrysopeea.com', 'sfeliciacristina@yahoo.com'], 'price': 1700},
- # tarif = {'COM ELECTRO SRL': {'mail': 'deeejas@yandex.com', 'price': 1000},
- # 'GAL BANCSI ZOLTAN PFA': {'mail': 'deeejas@yandex.com', 'price': 50}}
- headers = ['Denumire', 'CF', 'J', 'Adresa', 'Oras', 'Judet', 'Prescurtat', 'Admin', 'AdminP', 'RCNP', 'Obs']
- def count_down(t, d_type, up_down, max_count=None):
- '''
- @param t: time from/to contdown
- @param d_type: osd m or h (minutes or hours)
- @param up_down: possible values are up, down
- @param max_count: up to number
- '''
- if up_down == 'down':
- _one = -1
- _OPERAND = operator.ge
- max_count = 0
- finish = 'count%s finished' % up_down
- elif up_down == 'up':
- _one = 1
- _OPERAND = operator.le
- finish = 'count%s finished' % up_down
- max_count = max_count
- while _OPERAND(t, max_count):
- if d_type == 'm':
- mins, secs = divmod(t, 60)
- tf = '{0:2d}:{1:2d}'.format(mins, secs)
- print(tf, end='\r')
- time.sleep(1)
- t += _one
- elif d_type == 'h':
- hors, rem = divmod(t, 60)
- mins, secs = divmod(rem, 60)
- tf = '{:02d} : {:02d} : {:02d}'.format(hors, mins, secs)
- print(tf, end='\r')
- time.sleep(1)
- t += _one
- else:
- print(finish)
|