__init__.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #-------------------------------------------------------------------------------
  2. # library to read winmentor paradox database
  3. #-------------------------------------------------------------------------------
  4. # from winmentor.dbread import WinMentor
  5. from .dbread import WinMentor
  6. # from winmentor.info_anaf import check_list, file_start
  7. from .info_anaf import check_list, file_open
  8. # from winmentor.mentorutils import Mentorutils
  9. from .mentorutils import Mentorutils
  10. # from winmentor.__init__ import count_down
  11. from ._invoice import Invoice, InvoiceDetails, HtmlEnvelope
  12. from .tax_mailer import M_mailer
  13. from .taxes import Taxes
  14. from .smslink import Smslink
  15. import time
  16. import operator
  17. # 'CHRYSOPEEA BRANDING & DESIGN S.R.L.': {'mail': ['cristina.stan@chrysopeea.com', 'sfeliciacristina@yahoo.com'], 'price': 1700},
  18. # tarif = {'COM ELECTRO SRL': {'mail': 'deeejas@yandex.com', 'price': 1000},
  19. # 'GAL BANCSI ZOLTAN PFA': {'mail': 'deeejas@yandex.com', 'price': 50}}
  20. headers = ['Denumire', 'CF', 'J', 'Adresa', 'Oras', 'Judet', 'Prescurtat', 'Admin', 'AdminP', 'RCNP', 'Obs']
  21. def count_down(t, d_type, up_down, max_count=None):
  22. '''
  23. @param t: time from/to contdown
  24. @param d_type: osd m or h (minutes or hours)
  25. @param up_down: possible values are up, down
  26. @param max_count: up to number
  27. '''
  28. if up_down == 'down':
  29. _one = -1
  30. _OPERAND = operator.ge
  31. max_count = 0
  32. finish = 'count%s finished' % up_down
  33. elif up_down == 'up':
  34. _one = 1
  35. _OPERAND = operator.le
  36. finish = 'count%s finished' % up_down
  37. max_count = max_count
  38. while _OPERAND(t, max_count):
  39. if d_type == 'm':
  40. mins, secs = divmod(t, 60)
  41. tf = '{0:2d}:{1:2d}'.format(mins, secs)
  42. print(tf, end='\r')
  43. time.sleep(1)
  44. t += _one
  45. elif d_type == 'h':
  46. hors, rem = divmod(t, 60)
  47. mins, secs = divmod(rem, 60)
  48. tf = '{:02d} : {:02d} : {:02d}'.format(hors, mins, secs)
  49. print(tf, end='\r')
  50. time.sleep(1)
  51. t += _one
  52. else:
  53. print(finish)