quick_hotkey_fr.py 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. from time import sleep
  2. # from subprocess import check_output
  3. import re
  4. # import subprocess as sp
  5. import keyboard as kb
  6. import pyautogui as gui
  7. import pywinctl as gw
  8. sleep_time = 0.05
  9. CONF = 0.8
  10. interval_ = 0.05
  11. mentor_user = 'Utilizator: Contab'
  12. def abbr(short_cut, abbr_message, modifier=''):
  13. shc = short_cut
  14. if shc == ' ':
  15. shc1 = re.findall(' +', shc)
  16. gui.typewrite(abbr_message)
  17. gui.press('left', presses=1, interval=0.001)
  18. gui.press('backspace', presses=1, interval=0.001)
  19. gui.press('right', presses=1, interval=0.001)
  20. else:
  21. shc1 = re.findall('[a-z0-9-]*', shc)
  22. gui.press('backspace', presses=len(''.join(shc1) + modifier), interval=interval_)
  23. # gui.typewrite(abbr_message, interval=sleep_time)
  24. kb.write(abbr_message)
  25. def _printer(func):
  26. def wrapper():
  27. print(func.__doc__, 'h_key performed')
  28. return func()
  29. return wrapper
  30. def mv_mouse_right():
  31. size = gui.size()
  32. gui.moveTo(size[0] / 1.01, size[1] / 1.01)
  33. # gui.click()
  34. def mv_mouse_cent():
  35. size = gui.size()
  36. gui.moveTo(size[0] / 2, size[1] / 2)
  37. @_printer
  38. def remake_journal():
  39. '''refacere jurnal'''
  40. try:
  41. # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  42. active_win = gw.getActiveWindowTitle()
  43. if mentor_user.title() in active_win.title():
  44. # # # mentor_win.activate()
  45. butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/contabile.png', confidence=CONF)
  46. sleep(0.1)
  47. if butt_x_y:
  48. gui.click(butt_x_y[0], butt_x_y[1])
  49. pos_x_y = gui.position()
  50. gui.moveTo(pos_x_y[0], pos_x_y[1])
  51. gui.press('enter')
  52. mv_mouse_cent()
  53. # gui.move(1, 1)
  54. except IndexError:
  55. print('activate mentor')
  56. @_printer
  57. def cash_registry():
  58. '''registru de casa'''
  59. try:
  60. # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  61. active_win = gw.getActiveWindowTitle()
  62. if mentor_user.title() in active_win.title():
  63. # # # mentor_win.activate()
  64. butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/trezorerie.png', confidence=CONF)
  65. sleep(0.1)
  66. if butt_x_y:
  67. gui.click(butt_x_y[0], butt_x_y[1])
  68. pos_x_y = gui.position()
  69. gui.moveTo(pos_x_y[0], pos_x_y[1])
  70. gui.press('right', 1, interval_)
  71. gui.press('down', 1, interval_)
  72. gui.press('return', 1, interval_)
  73. mv_mouse_cent()
  74. # print('please activate Window LISTE')
  75. except IndexError:
  76. print('activate mentor')
  77. @_printer
  78. def clients_ron():
  79. '''clienti datornici'''
  80. try:
  81. # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  82. active_win = gw.getActiveWindowTitle()
  83. if mentor_user.title() in active_win.title():
  84. # # # mentor_win.activate()
  85. butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/parteneri.png', confidence=CONF)
  86. sleep(0.1)
  87. if butt_x_y:
  88. gui.click(butt_x_y[0], butt_x_y[1])
  89. pos_x_y = gui.position()
  90. gui.moveTo(pos_x_y[0], pos_x_y[1])
  91. gui.press('right', 1, interval_)
  92. # gui.press('down', 2, interval_)
  93. gui.press('return', 2, interval_)
  94. mv_mouse_cent()
  95. except IndexError:
  96. print('activate mentor')
  97. @_printer
  98. def verif_balance():
  99. '''balanta de verificare'''
  100. try:
  101. # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  102. active_win = gw.getActiveWindowTitle()
  103. if mentor_user.title() in active_win.title():
  104. # # # mentor_win.activate()
  105. butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/contabile.png', confidence=CONF)
  106. sleep(0.1)
  107. if butt_x_y:
  108. gui.click(butt_x_y[0], butt_x_y[1])
  109. pos_x_y = gui.position()
  110. gui.moveTo(pos_x_y[0], pos_x_y[1])
  111. gui.press('down', 1, interval_)
  112. gui.press('right', 1, interval_)
  113. gui.press('down', 1, interval_)
  114. gui.press('return', 2, interval_)
  115. mv_mouse_cent()
  116. except IndexError:
  117. print('activate mentor')
  118. @_printer
  119. def suppliers_ron():
  120. '''furnizori neachitati'''
  121. try:
  122. # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  123. active_win = gw.getActiveWindowTitle()
  124. if mentor_user.title() in active_win.title():
  125. # # # mentor_win.activate()
  126. butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/parteneri.png', confidence=CONF)
  127. sleep(0.1)
  128. if butt_x_y:
  129. gui.click(butt_x_y[0], butt_x_y[1])
  130. pos_x_y = gui.position()
  131. gui.moveTo(pos_x_y[0], pos_x_y[1])
  132. gui.press('down', 1, interval_)
  133. gui.press('right', 1, interval_)
  134. gui.press('down', 3, interval_)
  135. gui.press('return', 2, interval_)
  136. mv_mouse_cent()
  137. except IndexError:
  138. print('activate mentor')
  139. @_printer
  140. def suppliers_ron_verif():
  141. '''furnizori neachitati'''
  142. try:
  143. # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  144. active_win = gw.getActiveWindowTitle()
  145. if mentor_user.title() in active_win.title():
  146. # # # mentor_win.activate()
  147. butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/parteneri.png', confidence=CONF)
  148. sleep(0.1)
  149. if butt_x_y:
  150. gui.click(butt_x_y[0], butt_x_y[1])
  151. pos_x_y = gui.position()
  152. gui.moveTo(pos_x_y[0], pos_x_y[1])
  153. gui.press('down', 1, interval_)
  154. gui.press('right', 1, interval_)
  155. gui.press('down', 2, interval_)
  156. gui.press('return', 2, interval_)
  157. mv_mouse_cent()
  158. except IndexError:
  159. print('activate mentor')
  160. @_printer
  161. def suppliers_val():
  162. '''furnizori neachitati eur'''
  163. try:
  164. # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  165. active_win = gw.getActiveWindowTitle()
  166. if mentor_user.title() in active_win.title():
  167. # # # mentor_win.activate()
  168. butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/parteneri.png', confidence=CONF)
  169. sleep(0.1)
  170. if butt_x_y:
  171. gui.click(butt_x_y[0], butt_x_y[1])
  172. pos_x_y = gui.position()
  173. gui.moveTo(pos_x_y[0], pos_x_y[1])
  174. gui.press('down', 1, interval_)
  175. gui.press('right', 1, interval_)
  176. gui.press('down', 4, interval_)
  177. gui.press('return', 2, interval_)
  178. mv_mouse_cent()
  179. except IndexError:
  180. print('activate mentor')
  181. @_printer
  182. def bank_registry_ron():
  183. '''registru de banca lei'''
  184. try:
  185. # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  186. active_win = gw.getActiveWindowTitle()
  187. if mentor_user.title() in active_win.title():
  188. # # # mentor_win.activate()
  189. butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/trezorerie.png', confidence=CONF)
  190. sleep(0.1)
  191. if butt_x_y:
  192. gui.click(butt_x_y[0], butt_x_y[1])
  193. pos_x_y = gui.position()
  194. gui.moveTo(pos_x_y[0], pos_x_y[1])
  195. gui.press('down', 4, interval_)
  196. gui.press('return', 1, interval_)
  197. mv_mouse_cent()
  198. except IndexError:
  199. print('activate mentor')
  200. @_printer
  201. def h_key12():
  202. '''registru de banca'''
  203. try:
  204. sleep(sleep_time)
  205. dummy = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  206. active_win = gw.getActiveWindowTitle()
  207. if dummy.title in active_win:
  208. try:
  209. dummy.activate()
  210. except Exception as e:
  211. print(str(e))
  212. mv_mouse_right()
  213. kb.press_and_release('ctrl+f10')
  214. # gui.press('f10')
  215. gui.press('right', 3, interval_)
  216. gui.press('down', 1, 0.0)
  217. gui.press('down', 6, 0.0)
  218. gui.press('return', 1, interval_)
  219. except IndexError:
  220. print('please activate Window LISTE')
  221. @_printer
  222. def bank_registry_val():
  223. '''registru de banca val'''
  224. try:
  225. # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  226. active_win = gw.getActiveWindowTitle()
  227. if mentor_user.title() in active_win.title():
  228. # # # mentor_win.activate()
  229. butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/trezorerie.png', confidence=CONF)
  230. sleep(0.1)
  231. if butt_x_y:
  232. gui.click(butt_x_y[0], butt_x_y[1])
  233. pos_x_y = gui.position()
  234. gui.moveTo(pos_x_y[0], pos_x_y[1])
  235. gui.press('down', 6, 0.0)
  236. gui.press('return', 1, interval_)
  237. mv_mouse_cent()
  238. except IndexError:
  239. print('activate mentor')
  240. def close_all_lists():
  241. '''inchide toate ferestrele'''
  242. try:
  243. # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  244. active_win = gw.getActiveWindowTitle()
  245. if mentor_user.title() in active_win.title():
  246. # # # mentor_win.activate()
  247. butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/inchidere.png', confidence=CONF)
  248. sleep(0.1)
  249. if butt_x_y:
  250. gui.click(butt_x_y[0], butt_x_y[1])
  251. pos_x_y = gui.position()
  252. gui.moveTo(pos_x_y[0], pos_x_y[1])
  253. mv_mouse_cent()
  254. except IndexError:
  255. print('activate mentor')
  256. def close_list():
  257. '''inchide fereastra'''
  258. try:
  259. # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  260. active_win = gw.getActiveWindowTitle()
  261. if mentor_user.title() in active_win.title():
  262. # # # mentor_win.activate()
  263. butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/close.png', confidence=CONF)
  264. sleep(0.1)
  265. if butt_x_y:
  266. gui.click(butt_x_y[0], butt_x_y[1])
  267. pos_x_y = gui.position()
  268. gui.moveTo(pos_x_y[0], pos_x_y[1])
  269. mv_mouse_cent()
  270. except IndexError:
  271. print('activate mentor')
  272. @_printer
  273. def account_details():
  274. '''fisa de cont'''
  275. try:
  276. # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  277. active_win = gw.getActiveWindowTitle()
  278. if mentor_user.title() in active_win.title():
  279. # # # mentor_win.activate()
  280. butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/contabile.png', confidence=CONF)
  281. sleep(0.1)
  282. if butt_x_y:
  283. gui.click(butt_x_y[0], butt_x_y[1])
  284. pos_x_y = gui.position()
  285. mv_mouse_right()
  286. gui.press('down', 6, 0.0)
  287. gui.press('return', 1, interval_)
  288. gui.moveTo(pos_x_y[0], pos_x_y[1])
  289. # mv_mouse_cent()
  290. except IndexError:
  291. print('activate mentor')
  292. @_printer
  293. def partner_balance():
  294. '''fisa partener'''
  295. try:
  296. # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  297. active_win = gw.getActiveWindowTitle()
  298. if mentor_user.title() in active_win.title():
  299. # # # mentor_win.activate()
  300. butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/parteneri.png', confidence=CONF)
  301. sleep(0.1)
  302. if butt_x_y:
  303. gui.click(butt_x_y[0], butt_x_y[1])
  304. pos_x_y = gui.position()
  305. gui.moveTo(pos_x_y[0], pos_x_y[1])
  306. gui.press('down', 1, 0.0)
  307. gui.press('down', 7, 0.0)
  308. gui.press('return', 2, interval_)
  309. mv_mouse_cent()
  310. except IndexError:
  311. print('activate mentor')
  312. @_printer
  313. def partner_balance2():
  314. '''balanta partener'''
  315. # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  316. active_win = gw.getActiveWindowTitle()
  317. if mentor_user.title() in active_win.title():
  318. # mentor_win.activate()
  319. butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/parteneri.png', confidence=CONF)
  320. sleep(0.1)
  321. if butt_x_y:
  322. gui.click(butt_x_y[0], butt_x_y[1])
  323. pos_x_y = gui.position()
  324. gui.moveTo(pos_x_y[0], pos_x_y[1])
  325. gui.press('down', 9, interval_)
  326. gui.press('return', 1, interval_)
  327. gui.press('down', 1, interval_)
  328. gui.press('return', 1, interval_)
  329. mv_mouse_cent()
  330. @_printer
  331. def assets():
  332. '''registru imobilizari'''
  333. # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  334. active_win = gw.getActiveWindowTitle()
  335. if mentor_user.title() in active_win.title():
  336. # mentor_win.activate()
  337. butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/miscari.png', confidence=CONF)
  338. sleep(0.1)
  339. if butt_x_y:
  340. gui.click(butt_x_y[0], butt_x_y[1])
  341. pos_x_y = gui.position()
  342. gui.moveTo(pos_x_y[0], pos_x_y[1])
  343. gui.press('down', 14, interval_)
  344. gui.press('return', 1, interval_)
  345. gui.press('down', 1, interval_)
  346. # gui.press('return', 1, sleep_time)
  347. mv_mouse_cent()
  348. @_printer
  349. def product_details():
  350. '''fisa de magazie'''
  351. # _date_ = gui.getWindow('LISTE - ')
  352. try:
  353. # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  354. active_win = gw.getActiveWindowTitle()
  355. if mentor_user.title() in active_win.title():
  356. # # # mentor_win.activate()
  357. butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/stocuri.png', confidence=CONF)
  358. sleep(0.1)
  359. if butt_x_y:
  360. gui.click(butt_x_y[0], butt_x_y[1])
  361. pos_x_y = gui.position()
  362. gui.moveTo(pos_x_y[0], pos_x_y[1])
  363. gui.press('right', 1, interval_)
  364. gui.press('return', 1, interval_)
  365. mv_mouse_cent()
  366. except IndexError:
  367. print('activate mentor')
  368. @_printer
  369. def stocks():
  370. '''stocuri pe gestiuni'''
  371. try:
  372. # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  373. active_win = gw.getActiveWindowTitle()
  374. if mentor_user.title() in active_win.title():
  375. # # # mentor_win.activate()
  376. butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/stocuri.png', confidence=CONF)
  377. sleep(0.1)
  378. if butt_x_y:
  379. gui.click(butt_x_y[0], butt_x_y[1])
  380. pos_x_y = gui.position()
  381. gui.moveTo(pos_x_y[0], pos_x_y[1])
  382. gui.press('down', 8, 0.0)
  383. gui.press('return', 1, interval_)
  384. mv_mouse_cent()
  385. except IndexError:
  386. print('activate mentor')
  387. @_printer
  388. def buy_journal():
  389. '''jurnal de cumparari'''
  390. # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  391. active_win = gw.getActiveWindowTitle()
  392. if mentor_user.title() in active_win.title():
  393. # mentor_win.activate()
  394. butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/trezorerie.png', confidence=CONF)
  395. sleep(0.1)
  396. if butt_x_y:
  397. gui.click(butt_x_y[0], butt_x_y[1])
  398. pos_x_y = gui.position()
  399. gui.moveTo(pos_x_y[0], pos_x_y[1])
  400. gui.press('down', 12, 0.0)
  401. gui.press('right', 1, sleep_time)
  402. gui.press('down', 3, sleep_time)
  403. gui.press('return', 1, sleep_time)
  404. mv_mouse_cent()
  405. # print('please activate Window LISTE')
  406. @_printer
  407. def sell_journal():
  408. '''jurnal de vanzari'''
  409. # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  410. active_win = gw.getActiveWindowTitle()
  411. if mentor_user.title() in active_win.title():
  412. # # # mentor_win.activate()
  413. butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/trezorerie.png', confidence=CONF)
  414. sleep(0.1)
  415. if butt_x_y:
  416. gui.click(butt_x_y[0], butt_x_y[1])
  417. pos_x_y = gui.position()
  418. gui.moveTo(pos_x_y[0], pos_x_y[1])
  419. gui.press('down', 13, 0.0)
  420. gui.press('right', 1, sleep_time)
  421. gui.press('down', 3, sleep_time)
  422. gui.press('return', 1, sleep_time)
  423. mv_mouse_cent()
  424. # print('please activate Window LISTE')
  425. @_printer
  426. def h_key19():
  427. '''pe cont 602.02'''
  428. try:
  429. sleep(sleep_time)
  430. # dummy = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  431. # active_win = gw.getActiveWindowTitle()
  432. # if dummy.title in active_win:
  433. # try:
  434. # dummy.activate()
  435. # except Exception as e:
  436. # print(str(e))
  437. mv_mouse_right()
  438. gui.press('return', 1, sleep_time)
  439. gui.press('down', 4, sleep_time)
  440. gui.press('return', 1, sleep_time)
  441. gui.press('backspace', 1, sleep_time)
  442. gui.typewrite('602.02', interval=sleep_time)
  443. gui.press('return', 1, sleep_time)
  444. except IndexError:
  445. print('please activate Window LISTE')
  446. @_printer
  447. def h_key20():
  448. '''pe cont 602.08'''
  449. try:
  450. sleep(sleep_time)
  451. # dummy = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  452. # active_win = gw.getActiveWindowTitle()
  453. # if dummy.title in active_win:
  454. # try:
  455. # dummy.activate()
  456. # except Exception as e:
  457. # print(str(e))
  458. mv_mouse_right()
  459. gui.press('return', 1, sleep_time)
  460. gui.press('down', 4, sleep_time)
  461. gui.press('return', 1, sleep_time)
  462. gui.press('backspace', 1, sleep_time)
  463. gui.typewrite('602.08', interval=sleep_time)
  464. gui.press('return', 1, sleep_time)
  465. except IndexError:
  466. print('please activate Window LISTE')
  467. @_printer
  468. def h_key21():
  469. '''pe cont 542'''
  470. try:
  471. sleep(sleep_time)
  472. # dummy = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  473. # active_win = gw.getActiveWindowTitle()
  474. # if dummy.title in active_win:
  475. # try:
  476. # dummy.activate()
  477. # except Exception as e:
  478. # print(str(e))
  479. mv_mouse_right()
  480. gui.press('return', 1, sleep_time)
  481. gui.press('down', 4, sleep_time)
  482. gui.press('return', 1, sleep_time)
  483. gui.press('backspace', 1, sleep_time)
  484. gui.typewrite('542', interval=sleep_time)
  485. gui.press('return', 1, sleep_time)
  486. except IndexError:
  487. print('please activate Window LISTE')
  488. @_printer
  489. def h_key22():
  490. '''pe cont 627'''
  491. try:
  492. sleep(sleep_time)
  493. # dummy = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  494. # active_win = gw.getActiveWindowTitle()
  495. # if dummy.title in active_win:
  496. # try:
  497. # dummy.activate()
  498. # except Exception as e:
  499. # print(str(e))
  500. mv_mouse_right()
  501. gui.press('return', 1, sleep_time)
  502. # gui.press('tab', 2, sleep_time)
  503. gui.press('down', 4, sleep_time)
  504. gui.press('return', 1, sleep_time)
  505. gui.press('backspace', 1, sleep_time)
  506. gui.typewrite('627', interval=sleep_time)
  507. gui.press('return', 1, sleep_time)
  508. except IndexError:
  509. print('please activate Window LISTE')
  510. @_printer
  511. def h_key23():
  512. '''pe cont 604'''
  513. try:
  514. sleep(sleep_time)
  515. # dummy = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  516. # active_win = gw.getActiveWindowTitle()
  517. # if dummy.title in active_win:
  518. # try:
  519. # dummy.activate()
  520. # except Exception as e:
  521. # print(str(e))
  522. mv_mouse_right()
  523. gui.press('return', 1, sleep_time)
  524. gui.press('down', 4, sleep_time)
  525. gui.press('return', 1, sleep_time)
  526. gui.press('backspace', 1, sleep_time)
  527. gui.typewrite('604', interval=sleep_time)
  528. gui.press('return', 1, sleep_time)
  529. except IndexError:
  530. print('please activate Window LISTE')
  531. @_printer
  532. def h_key24():
  533. '''pe cont 628'''
  534. try:
  535. sleep(sleep_time)
  536. # dummy = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  537. # active_win = gw.getActiveWindowTitle()
  538. # if dummy.title in active_win:
  539. # try:
  540. # dummy.activate()
  541. # except Exception as e:
  542. # print(str(e))
  543. mv_mouse_right()
  544. gui.press('return', 1, sleep_time)
  545. gui.press('down', 4, sleep_time)
  546. gui.press('return', 1, sleep_time)
  547. gui.press('backspace', 1, sleep_time)
  548. gui.typewrite('628', interval=sleep_time)
  549. gui.press('return', 1, sleep_time)
  550. except IndexError:
  551. print('please activate Window LISTE')
  552. @_printer
  553. def h_key28():
  554. '''pe cont 623'''
  555. try:
  556. sleep(sleep_time)
  557. # dummy = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
  558. # active_win = gw.getActiveWindowTitle()
  559. # if dummy.title in active_win:
  560. # try:
  561. # dummy.activate()
  562. # except Exception as e:
  563. # print(str(e))
  564. mv_mouse_right()
  565. gui.press('return', 1, sleep_time)
  566. gui.press('down', 4, sleep_time)
  567. gui.press('return', 1, sleep_time)
  568. gui.press('backspace', 1, sleep_time)
  569. gui.typewrite('623', interval=sleep_time)
  570. gui.press('return', 1, sleep_time)
  571. except IndexError:
  572. print('please activate Window LISTE')
  573. # for i in gui.getWindows():
  574. # print(i)
  575. def main():
  576. '''quick_hotkey_fr'''
  577. kb.register_hotkey('`+r+j', remake_journal, args=()) # refacere jurnal
  578. kb.register_hotkey('`+r+c', cash_registry, args=()) # casa
  579. kb.register_hotkey('`+c+z', clients_ron, args=()) # clienti
  580. kb.register_hotkey('`+b+v', verif_balance, args=()) # balanta
  581. kb.register_hotkey('`+r+f', suppliers_ron, args=()) # ron furnizori
  582. kb.register_hotkey('`+r+x', suppliers_ron_verif, args=()) # ron furnizori
  583. kb.register_hotkey('`+d+x', suppliers_val, args=()) # deviza furnizori
  584. kb.register_hotkey('`+f+t', partner_balance, args=()) # fisa terti
  585. kb.register_hotkey('`+r+b', bank_registry_ron, args=()) # banca lei
  586. kb.register_hotkey('`+j+v', bank_registry_val, args=()) # banca valuta
  587. kb.register_hotkey('`+f+x', account_details, args=()) # fisa cont
  588. kb.register_hotkey('`+s+m', product_details, args=()) # fisa magazie
  589. kb.register_hotkey('`+s+g', stocks, args=()) # stoc gestiuni
  590. kb.register_hotkey('control+q', close_all_lists, args=()) # close all lists
  591. kb.register_hotkey('control+e', close_list, args=()) # close all lists
  592. kb.register_hotkey('`+t+x', buy_journal, args=()) # jurnal de cumparari
  593. kb.register_hotkey('`+t+v', sell_journal, args=()) # jurnal de vanzari
  594. kb.register_hotkey('`+b+p', partner_balance2, args=()) # balanta parteneri
  595. kb.register_hotkey('`+m+u', assets, args=()) # imobilizari
  596. # kb.register_hotkey('alt+3', h_key28, args=()) # 602.08
  597. # kb.register_hotkey('alt+4', h_key22, args=()) # 627
  598. # kb.register_hotkey('alt+5', h_key21, args=()) # 542
  599. # kb.register_hotkey('alt+6', h_key23, args=()) # 604
  600. # kb.register_hotkey('alt+7', h_key24, args=()) # 628
  601. # kb.register_hotkey('alt+8', h_key19, args=()) # 602.02
  602. # kb.register_hotkey('alt+9', h_key20, args=()) # 602.08
  603. # kb.register_hotkey('control+shift+0', enclose_pharenteses, args=())
  604. # kb.register_hotkey('control+shift+]', enclose_list, args=())
  605. # kb.register_hotkey('control+shift+`', enclose_dict, args=())
  606. # kb.register_hotkey('shift+`', indent_comment, args=())
  607. # kb.wait()
  608. if __name__ == '__main__':
  609. main()