xython 4.7.2__tar.gz → 4.7.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. {xython-4.7.2/src/xython.egg-info → xython-4.7.3}/PKG-INFO +1 -1
  2. {xython-4.7.2 → xython-4.7.3}/pyproject.toml +1 -1
  3. {xython-4.7.2 → xython-4.7.3}/src/xython/xy_auto.py +40 -31
  4. {xython-4.7.2 → xython-4.7.3}/src/xython/xy_color.py +1 -30
  5. {xython-4.7.2 → xython-4.7.3}/src/xython/xy_db.py +23 -23
  6. {xython-4.7.2 → xython-4.7.3}/src/xython/xy_edge.py +138 -91
  7. {xython-4.7.2 → xython-4.7.3}/src/xython/xy_excel.py +974 -726
  8. {xython-4.7.2 → xython-4.7.3}/src/xython/xy_hwp.py +141 -63
  9. {xython-4.7.2 → xython-4.7.3}/src/xython/xy_list.py +21 -24
  10. {xython-4.7.2 → xython-4.7.3}/src/xython/xy_map.py +68 -40
  11. {xython-4.7.2 → xython-4.7.3}/src/xython/xy_outlook.py +14 -20
  12. {xython-4.7.2 → xython-4.7.3}/src/xython/xy_time.py +189 -70
  13. {xython-4.7.2 → xython-4.7.3}/src/xython/xy_util.py +727 -70
  14. {xython-4.7.2 → xython-4.7.3}/src/xython/xy_word.py +134 -61
  15. {xython-4.7.2 → xython-4.7.3/src/xython.egg-info}/PKG-INFO +1 -1
  16. {xython-4.7.2 → xython-4.7.3}/MANIFEST.in +0 -0
  17. {xython-4.7.2 → xython-4.7.3}/README.md +0 -0
  18. {xython-4.7.2 → xython-4.7.3}/setup.cfg +0 -0
  19. {xython-4.7.2 → xython-4.7.3}/src/xython/__init__.py +0 -0
  20. {xython-4.7.2 → xython-4.7.3}/src/xython/alias_installer.py +0 -0
  21. {xython-4.7.2 → xython-4.7.3}/src/xython/locales_loader.py +0 -0
  22. {xython-4.7.2 → xython-4.7.3}/src/xython/xy_chrome.py +0 -0
  23. {xython-4.7.2 → xython-4.7.3}/src/xython/xy_common.py +0 -0
  24. {xython-4.7.2 → xython-4.7.3}/src/xython/xy_excel_event.py +0 -0
  25. {xython-4.7.2 → xython-4.7.3}/src/xython/xy_manual.py +0 -0
  26. {xython-4.7.2 → xython-4.7.3}/src/xython/xy_re.py +0 -0
  27. {xython-4.7.2 → xython-4.7.3}/src/xython.egg-info/SOURCES.txt +0 -0
  28. {xython-4.7.2 → xython-4.7.3}/src/xython.egg-info/dependency_links.txt +0 -0
  29. {xython-4.7.2 → xython-4.7.3}/src/xython.egg-info/requires.txt +0 -0
  30. {xython-4.7.2 → xython-4.7.3}/src/xython.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xython
3
- Version: 4.7.2
3
+ Version: 4.7.3
4
4
  Summary: xython package
5
5
  Author-email: "SJ.Park" <sjpkorea@naver.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "xython"
7
- version = "4.7.2"
7
+ version = "4.7.3"
8
8
  description = "xython package"
9
9
  readme = {file = "README.md", content-type = "text/markdown"}
10
10
  requires-python = ">=3.8"
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  import winreg
3
3
  import screeninfo, subprocess
4
- import time, math, sys
4
+ import time, math
5
5
  import ctypes
6
6
  import ctypes.wintypes
7
7
  from screeninfo import get_monitors
@@ -170,23 +170,8 @@ def _hotkey(*key_names):
170
170
  if vk:
171
171
  _key_up(vk)
172
172
 
173
- # 별칭을 지정하는 데코레이터
174
- def alias(*names):
175
- def decorator(func):
176
- # 함수 객체에 _aliases 라는 속성으로 별칭들을 저장합니다.
177
- func._aliases = names
178
- return func
179
- return decorator
180
-
181
- # 클래스 내부의 데코레이터들을 실제 메서드로 등록해주는 클래스 데코레이터
182
- def apply_aliases(cls):
183
- for name, attr in list(vars(cls).items()):
184
- if hasattr(attr, "_aliases"):
185
- for alias_name in attr._aliases:
186
- setattr(cls, alias_name, attr)
187
- return cls
188
-
189
- @apply_aliases
173
+
174
+
190
175
  class xy_auto:
191
176
  """
192
177
  마우스를 클릭하고 키보드를 자동으로 작동이 가능하게 만든 모듈
@@ -308,7 +293,9 @@ class xy_auto:
308
293
  if vk:
309
294
  _press_key(vk)
310
295
 
311
- @alias("is_maximized_for_handle_no")
296
+ def is_maximized_for_handle_no(self, handle):
297
+ return self.check_maximized_by_program_handle_no(handle)
298
+
312
299
  def check_maximized_by_program_handle_no(self, handle):
313
300
  """
314
301
  입력으로 들어오는 handle의 어플리케이션이 최대화인지를 확인하는 것
@@ -349,7 +336,9 @@ class xy_auto:
349
336
  result = False
350
337
  return result
351
338
 
352
- @alias("click_left_mouse")
339
+ def click_left_mouse(self, xy=None):
340
+ return self.click_mouse(xy)
341
+
353
342
  def click_mouse(self, xy=None):
354
343
  """
355
344
  왼쪽 마우스를 클릭하는것 (Down+Up)
@@ -498,7 +487,9 @@ class xy_auto:
498
487
  """현재 선택된 것을 복사하기"""
499
488
  _hotkey('ctrl', 'c')
500
489
 
501
- @alias("copy_all")
490
+ def copy_all(self):
491
+ return self.copy_current_top_page()
492
+
502
493
  def copy_current_top_page(self):
503
494
  """
504
495
  최상위의 프로그램을 전체를 선택하고 값을 복사하는 것
@@ -515,7 +506,9 @@ class xy_auto:
515
506
  """텍스트를 클립보드에 복사"""
516
507
  _clipboard_copy(input_text)
517
508
 
518
- @alias("dclick_mouse")
509
+ def dclick_mouse(self, xy=None):
510
+ return self.dclick_mouse_left(xy)
511
+
519
512
  def dclick_mouse_left(self, xy=None):
520
513
  """
521
514
  double click
@@ -672,7 +665,9 @@ class xy_auto:
672
665
  return found_locations
673
666
  return found_locations
674
667
 
675
- @alias("get_handle_no_all")
668
+ def get_handle_no_all(self):
669
+ return self.get_all_handle_no()
670
+
676
671
  def get_all_handle_no(self):
677
672
  """
678
673
  모든 핸들 번호 갖고오기
@@ -698,7 +693,9 @@ class xy_auto:
698
693
  """
699
694
  return self.varx["key_list"]
700
695
 
701
- @alias("get_all_installed_program_id")
696
+ def get_all_installed_program_id(self):
697
+ return self.get_all_pid_for_all_installed_program()
698
+
702
699
  def get_all_pid_for_all_installed_program(self):
703
700
  """
704
701
  현재 컴퓨터안에 설치된 모든 프로그램의 ID
@@ -736,7 +733,9 @@ class xy_auto:
736
733
  GA_ROOTOWNER = 3
737
734
  return ctypes.windll.user32.GetAncestor(hwnd, GA_ROOT)
738
735
 
739
- @alias("get_center_pxy_of_image_in_monitor")
736
+ def get_center_pxy_of_image_in_monitor(self, file_name):
737
+ return self.get_center_pxy_for_selected_image(file_name)
738
+
740
739
  def get_center_pxy_for_selected_image(self, file_name):
741
740
  """
742
741
  화면에서 저장된 이미지랑 같은 위치를 찾아서 중심 좌표 반환
@@ -750,7 +749,9 @@ class xy_auto:
750
749
  return (cx, cy)
751
750
  return None
752
751
 
753
- @alias("get_dpi_for_active_monitor")
752
+ def get_dpi_for_active_monitor(self):
753
+ return self.get_dpi()
754
+
754
755
  def get_dpi(self):
755
756
  """현재 장치의 dpi를 구하는 코드"""
756
757
  hdc = ctypes.windll.user32.GetDC(0)
@@ -758,7 +759,9 @@ class xy_auto:
758
759
  ctypes.windll.user32.ReleaseDC(0, hdc)
759
760
  return dpi
760
761
 
761
- @alias("get_pid_for_excel")
762
+ def get_pid_for_excel(self):
763
+ return self.get_excel_pid()
764
+
762
765
  def get_excel_pid(self):
763
766
  """엑셀프로그램의 pid를 갖고오는 것"""
764
767
  for proc in psutil.process_iter(['pid', 'name']):
@@ -1128,7 +1131,9 @@ class xy_auto:
1128
1131
  height = win32api.GetSystemMetrics(win32con.SM_CYSCREEN)
1129
1132
  return width, height
1130
1133
 
1131
- @alias("get_next_window")
1134
+ def get_next_window(self):
1135
+ return self.get_next_window_from_active_window()
1136
+
1132
1137
  def get_next_window_from_active_window(self):
1133
1138
  """
1134
1139
  현재 활성화된 윈도우 다음의 창을 가져옴
@@ -1536,7 +1541,9 @@ class xy_auto:
1536
1541
  x, y = win32api.GetCursorPos()
1537
1542
  win32api.SetCursorPos((x + x1, y + y1))
1538
1543
 
1539
- @alias("scroll_screen_by_click_num")
1544
+ def scroll_screen_by_click_num(self, input_no):
1545
+ return self.move_screen_by_scroll(input_no)
1546
+
1540
1547
  def move_screen_by_scroll(self, input_no):
1541
1548
  """현재 위치에서 상하로 스크롤 (+ 위, - 아래)"""
1542
1549
  win32api.mouse_event(win32con.MOUSEEVENTF_WHEEL, 0, 0, input_no * 120, 0)
@@ -1557,7 +1564,9 @@ class xy_auto:
1557
1564
  """복사후 붙여넣기"""
1558
1565
  _hotkey('ctrl', 'v')
1559
1566
 
1560
- @alias("paste_text_from_clipboard")
1567
+ def paste_text_from_clipboard(self):
1568
+ return self.paste_clipboard()
1569
+
1561
1570
  def paste_clipboard(self):
1562
1571
  """클립보드의 내용을 읽어 반환"""
1563
1572
  result = _clipboard_paste()
@@ -2007,7 +2016,7 @@ def _get_vk(key_name):
2007
2016
  Returns:
2008
2017
  처리 결과 값 (자세한 내용은 함수 본문 참고).
2009
2018
  """
2010
- _VK_MAP = xy_common.xy_common().varx["auto"]["_VK_MAP"]
2019
+ #_VK_MAP = xy_common.xy_common().varx["auto"]["_VK_MAP"]
2011
2020
  """키 이름 → 가상키코드 반환"""
2012
2021
  key_name = str(key_name).lower()
2013
2022
  if key_name in _VK_MAP:
@@ -1,32 +1,9 @@
1
1
  # -*- coding: utf-8 -*-
2
- import re, math # 내장모듈
3
2
  import win32api, win32gui
4
3
  from xython import xy_re, xy_common # xython 모듈
5
- import re, math, numbers, colorsys, difflib # 내장모듈
4
+ import re, math # 내장모듈
6
5
  from win32ctypes.pywin32 import win32api
7
6
 
8
- from unittest.mock import patch
9
- with patch("ctypes.windll.user32.SetProcessDPIAware", autospec=True):
10
- import pyautogui
11
-
12
-
13
- # 별칭을 지정하는 데코레이터
14
- def alias(*names):
15
- def decorator(func):
16
- # 함수 객체에 _aliases 라는 속성으로 별칭들을 저장합니다.
17
- func._aliases = names
18
- return func
19
- return decorator
20
-
21
- # 클래스 내부의 데코레이터들을 실제 메서드로 등록해주는 클래스 데코레이터
22
- def apply_aliases(cls):
23
- for name, attr in list(vars(cls).items()):
24
- if hasattr(attr, "_aliases"):
25
- for alias_name in attr._aliases:
26
- setattr(cls, alias_name, attr)
27
- return cls
28
-
29
- @apply_aliases
30
7
  class xy_color:
31
8
  """
32
9
  색을 편하게 사용하기위해 만든 모듈
@@ -2613,12 +2590,6 @@ class xy_color:
2613
2590
  result.append(1.0)
2614
2591
  return result
2615
2592
 
2616
- def to_rgbint(self, input_xcolor):
2617
- """
2618
- 사용의 편의성을 위해 만듦
2619
- """
2620
- return self.to_rgbint(input_xcolor)
2621
-
2622
2593
  def to_rgbint(self, input_xcolor):
2623
2594
  """
2624
2595
  xcolor값을 rgbint로 변경
@@ -2,23 +2,8 @@
2
2
  import os, sqlite3 # 내장모듈
3
3
  from xython import xy_excel, xy_util # xython 모듈
4
4
  import pandas as pd
5
- # 별칭을 지정하는 데코레이터
6
- def alias(*names):
7
- def decorator(func):
8
- # 함수 객체에 _aliases 라는 속성으로 별칭들을 저장합니다.
9
- func._aliases = names
10
- return func
11
- return decorator
12
-
13
- # 클래스 내부의 데코레이터들을 실제 메서드로 등록해주는 클래스 데코레이터
14
- def apply_aliases(cls):
15
- for name, attr in list(vars(cls).items()):
16
- if hasattr(attr, "_aliases"):
17
- for alias_name in attr._aliases:
18
- setattr(cls, alias_name, attr)
19
- return cls
20
-
21
- @apply_aliases
5
+
6
+
22
7
  class xy_db:
23
8
  """
24
9
  database를 사용하기 쉽게 만든것
@@ -709,8 +694,15 @@ class xy_db:
709
694
  return y_name
710
695
 
711
696
 
712
- @alias('set_database_for_sqlite')
713
- @alias("make_cursor_for_sqlite_db","make_db_for_sqlite")
697
+ def set_database_for_sqlite(self, db_name=""):
698
+ return self.connect_sqlite_db(db_name)
699
+
700
+ def make_cursor_for_sqlite_db(self, db_name=""):
701
+ return self.connect_sqlite_db(db_name)
702
+
703
+ def make_db_for_sqlite(self, db_name=""):
704
+ return self.connect_sqlite_db(db_name)
705
+
714
706
  def connect_sqlite_db(self, db_name=""):
715
707
  """
716
708
  database에 연결하기
@@ -1230,7 +1222,9 @@ class xy_db:
1230
1222
  col_type = "text"
1231
1223
  if not y_name in all_exist_yline_name:
1232
1224
  self.cursor.execute("alter table %s add column '%s' '%s'" % (table_name, y_name, col_type))
1233
- @alias("insert_yy_line_in_sqlite_table")
1225
+ def insert_yy_line_in_sqlite_table(self, db_name, table_name, col_data_list_s):
1226
+ return self.insert_yline_in_sqlite_table_by_title_list(db_name, table_name, col_data_list_s)
1227
+
1234
1228
  def insert_yline_in_sqlite_table_by_title_list(self, db_name, table_name, col_data_list_s):
1235
1229
  """
1236
1230
  (여러줄) 새로운 새로 컬럼을 만든다
@@ -1681,7 +1675,9 @@ class xy_db:
1681
1675
  result = self.update_dic1_to_dic2(dic1, dic2)
1682
1676
  return result
1683
1677
 
1684
- @alias("plus_list1_to_list2")
1678
+ def plus_list1_to_list2(self, list1, list2):
1679
+ return self.extend_list1_to_list2(list1, list2)
1680
+
1685
1681
  def extend_list1_to_list2(self, list1, list2):
1686
1682
  """
1687
1683
  list1의 자료를 list2에 추가하는 것
@@ -1693,8 +1689,12 @@ class xy_db:
1693
1689
  list1.extend(list2)
1694
1690
  return list1
1695
1691
 
1696
- @alias('update_set1_to_set2')
1697
- @alias("plus_set1_to_set2")
1692
+ def update_set1_to_set2(self, set1, set2):
1693
+ return self.extend_set1_to_set2(set1, set2)
1694
+
1695
+ def plus_set1_to_set2(self, set1, set2):
1696
+ return self.extend_set1_to_set2(set1, set2)
1697
+
1698
1698
  def extend_set1_to_set2(self, set1, set2):
1699
1699
  """
1700
1700
  set1의 자료를 set2에 추가하는 것