xython 4.5.2__tar.gz → 4.5.4__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 (29) hide show
  1. {xython-4.5.2/src/xython.egg-info → xython-4.5.4}/PKG-INFO +1 -1
  2. {xython-4.5.2 → xython-4.5.4}/pyproject.toml +1 -1
  3. {xython-4.5.2 → xython-4.5.4}/src/xython/xy_auto.py +3 -3
  4. {xython-4.5.2 → xython-4.5.4}/src/xython/xy_chrome.py +12 -14
  5. {xython-4.5.2 → xython-4.5.4}/src/xython/xy_color.py +9 -1
  6. {xython-4.5.2 → xython-4.5.4}/src/xython/xy_db.py +17 -17
  7. {xython-4.5.2 → xython-4.5.4}/src/xython/xy_edge.py +5 -7
  8. {xython-4.5.2 → xython-4.5.4}/src/xython/xy_excel.py +350 -342
  9. {xython-4.5.2 → xython-4.5.4}/src/xython/xy_map.py +3 -3
  10. {xython-4.5.2 → xython-4.5.4}/src/xython/xy_outlook.py +83 -25
  11. {xython-4.5.2 → xython-4.5.4}/src/xython/xy_time.py +3 -3
  12. {xython-4.5.2 → xython-4.5.4}/src/xython/xy_util.py +31 -31
  13. {xython-4.5.2 → xython-4.5.4}/src/xython/xy_word.py +39 -39
  14. {xython-4.5.2 → xython-4.5.4/src/xython.egg-info}/PKG-INFO +1 -1
  15. {xython-4.5.2 → xython-4.5.4}/MANIFEST.in +0 -0
  16. {xython-4.5.2 → xython-4.5.4}/README.md +0 -0
  17. {xython-4.5.2 → xython-4.5.4}/requirements.txt +0 -0
  18. {xython-4.5.2 → xython-4.5.4}/setup.cfg +0 -0
  19. {xython-4.5.2 → xython-4.5.4}/src/xython/__init__.py +0 -0
  20. {xython-4.5.2 → xython-4.5.4}/src/xython/_easy_start.py +0 -0
  21. {xython-4.5.2 → xython-4.5.4}/src/xython/xy_common.py +0 -0
  22. {xython-4.5.2 → xython-4.5.4}/src/xython/xy_excel_event.py +0 -0
  23. {xython-4.5.2 → xython-4.5.4}/src/xython/xy_hwp.py +0 -0
  24. {xython-4.5.2 → xython-4.5.4}/src/xython/xy_list.py +0 -0
  25. {xython-4.5.2 → xython-4.5.4}/src/xython/xy_re.py +0 -0
  26. {xython-4.5.2 → xython-4.5.4}/src/xython.egg-info/SOURCES.txt +0 -0
  27. {xython-4.5.2 → xython-4.5.4}/src/xython.egg-info/dependency_links.txt +0 -0
  28. {xython-4.5.2 → xython-4.5.4}/src/xython.egg-info/requires.txt +0 -0
  29. {xython-4.5.2 → xython-4.5.4}/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.5.2
3
+ Version: 4.5.4
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.5.2"
7
+ version = "4.5.4"
8
8
  description = "xython package"
9
9
  readme = {file = "README.md", content-type = "text/markdown"}
10
10
  requires-python = ">=3.8"
@@ -186,7 +186,7 @@ class xy_auto:
186
186
  """
187
187
  def __init__(self):
188
188
  self.varx = xy_common.xy_common().varx
189
- self.xycolor = xy_color.xy_color()
189
+ self.colorx = xy_color.xy_color()
190
190
 
191
191
  def activate_edge_tab_by_title(self, keyword):
192
192
  """엣지 웹브라우저의 탭을 선택하는 것"""
@@ -493,8 +493,8 @@ class xy_auto:
493
493
  handle = user32.GetDesktopWindow()
494
494
  hdc = user32.GetDC(handle)
495
495
  null_brush = gdi32.GetStockObject(5)
496
- hex_color = self.xycolor.change_xcolor_to_rgb(xcolor)
497
- red_pen = gdi32.CreatePen(0, 2, self.xycolor.change_rgb_to_hex_rgb(hex_color[0], hex_color[1], hex_color[2]))
496
+ hex_color = self.colorx.change_xcolor_to_rgb(xcolor)
497
+ red_pen = gdi32.CreatePen(0, 2, self.colorx.change_rgb_to_hex_rgb(hex_color[0], hex_color[1], hex_color[2]))
498
498
  old_brush = gdi32.SelectObject(hdc, null_brush)
499
499
  old_pen = gdi32.SelectObject(hdc, red_pen)
500
500
  gdi32.Rectangle(hdc, int(left), int(top), int(right), int(bottom))
@@ -68,9 +68,7 @@ class xy_chrome:
68
68
  auto_connect: True = 자동으로 연결/실행, False = 수동
69
69
  """
70
70
  # 공통 변수 설정
71
- self.xyutil = xy_util.xy_util()
72
- self.xyre = xy_re.xy_re()
73
-
71
+ self.utilx = xy_util.xy_util()
74
72
  self.chrome_paths = self._find_chrome_paths()
75
73
 
76
74
  self.port = port
@@ -1300,7 +1298,7 @@ class xy_chrome:
1300
1298
  html_code = self.get_html_code("https://info.bptc.co.kr/content/od/frame/yard_new_empty_frame_od_kr.jsp?p_id=EMPT_NE_KR&snb_num=8&snb_div=service&pop_ok=Y")
1301
1299
  l3d = self.html_tables_to_list(html_code)
1302
1300
  result = self.make_list_for_1(l3d)
1303
- self.xyutil.print_one_by_one(result)
1301
+ self.utilx.print_one_by_one(result)
1304
1302
  return result
1305
1303
 
1306
1304
  def port_2(self):
@@ -1313,7 +1311,7 @@ class xy_chrome:
1313
1311
  con_type = l1d[0][2:]
1314
1312
  for index, value in enumerate(l1d[1:]):
1315
1313
  result.append([port, con_type, con_size, l2d[0][index + 1], value])
1316
- self.xyutil.print_one_by_one(result)
1314
+ self.utilx.print_one_by_one(result)
1317
1315
  return result
1318
1316
 
1319
1317
  def port_3(self):
@@ -1327,7 +1325,7 @@ class xy_chrome:
1327
1325
  con_size = l2d[0][index + 1][:2]
1328
1326
  con_type = l2d[0][index + 1][2:]
1329
1327
  result.append([port, con_type, con_size, l1d[0], value])
1330
- self.xyutil.print_one_by_one(result)
1328
+ self.utilx.print_one_by_one(result)
1331
1329
  return result
1332
1330
 
1333
1331
  def port_4(self):
@@ -1341,7 +1339,7 @@ class xy_chrome:
1341
1339
  con_size = l2d[0][index + 1][:2]
1342
1340
  con_type = l2d[0][index + 1][2:]
1343
1341
  result.append([port, con_type, con_size, l1d[0], value])
1344
- self.xyutil.print_one_by_one(result)
1342
+ self.utilx.print_one_by_one(result)
1345
1343
  return result
1346
1344
 
1347
1345
  def port_5(self):
@@ -1356,7 +1354,7 @@ class xy_chrome:
1356
1354
  con_size = l2d[0][index + 1][:2]
1357
1355
  con_type = l2d[0][index + 1][2:]
1358
1356
  result.append([port, con_type, con_size, l1d[0], value])
1359
- self.xyutil.print_one_by_one(result)
1357
+ self.utilx.print_one_by_one(result)
1360
1358
  return result
1361
1359
 
1362
1360
  def port_6(self):
@@ -1371,14 +1369,14 @@ class xy_chrome:
1371
1369
  con_size = l2d[0][index + 1]
1372
1370
  con_type = ""
1373
1371
  result.append([port, con_type, con_size, l1d[0], value])
1374
- self.xyutil.print_one_by_one(result)
1372
+ self.utilx.print_one_by_one(result)
1375
1373
  return result
1376
1374
 
1377
1375
  def port_7(self):
1378
1376
  html_code = self.get_html_code("https://snct.sun-kwang.co.kr/infoservice/webpage/main/mainPage_iframe.jsp?type=IFRAME_EMPTY_ALL")
1379
1377
  l2d = self.html_tables_to_list(html_code)[-1]
1380
1378
  result = self.make_list_7(l2d)
1381
- self.xyutil.print_one_by_one(result)
1379
+ self.utilx.print_one_by_one(result)
1382
1380
  return result
1383
1381
 
1384
1382
  def port_9(self):
@@ -1405,7 +1403,7 @@ class xy_chrome:
1405
1403
  l2d.append(str(one_line).split("\t"))
1406
1404
  for no in range(1, len(l2d[0])):
1407
1405
  result.append(["style10", l2d[2][no], l2d[1][no], l2d[0][no], l2d[3][no]])
1408
- self.xyutil.print_one_by_one(result)
1406
+ self.utilx.print_one_by_one(result)
1409
1407
  return result
1410
1408
 
1411
1409
  def port_11(self):
@@ -1426,7 +1424,7 @@ class xy_chrome:
1426
1424
  con_type = l1d[0][2:]
1427
1425
  for index, value in enumerate(l1d[1:]):
1428
1426
  result.append(["style11", con_type, con_size, l2d[0][index + 1], value])
1429
- self.xyutil.print_one_by_one(result)
1427
+ self.utilx.print_one_by_one(result)
1430
1428
  return result
1431
1429
 
1432
1430
  def port_12(self):
@@ -1452,7 +1450,7 @@ class xy_chrome:
1452
1450
  for index, value in enumerate(l1d):
1453
1451
  result.append(["style12", "", l2d[0][index] if index < len(l2d[0]) else "", l1d[0], value])
1454
1452
 
1455
- self.xyutil.print_one_by_one(result)
1453
+ self.utilx.print_one_by_one(result)
1456
1454
  return result
1457
1455
 
1458
1456
  def port_13(self):
@@ -1475,7 +1473,7 @@ class xy_chrome:
1475
1473
  # [FIX] 기존: ["style13", "DRY", l2d[1][index], l1d[0], value]
1476
1474
  # 수정: con_size, con_type 을 정상 사용, 선사는 l2d[1][index+1]
1477
1475
  result.append(["style13", con_type, con_size, l2d[1][index + 1] if (index + 1) < len(l2d[1]) else "", value])
1478
- self.xyutil.print_one_by_one(result)
1476
+ self.utilx.print_one_by_one(result)
1479
1477
  return result
1480
1478
 
1481
1479
  def port_15(self):
@@ -69,7 +69,15 @@ class xy_color:
69
69
  # xcolor에서 - 추출
70
70
  re_com4 = re.compile(r"[-]+")
71
71
  xcolor_minus = re_com4.findall(input_xcolor)
72
- if xcolor_minus: result[4] = len(xcolor_minus[0])
72
+ if xcolor_minus:
73
+ result[4] = len(xcolor_minus[0])
74
+
75
+ if result[1] and result[2] and (result[3]==1 or result[4]==1):
76
+ # "red-50, red50-, red50+, red+50이라는 형태도 사용이 가능하게 하는것
77
+ if result[3]:
78
+ result[2] = 50 +(result[2]/2)
79
+ elif result[4]:
80
+ result[2] = 50 - (result[4] / 2)
73
81
  return result
74
82
 
75
83
  def add_alpha_to_rgb(self, input_rgb, alpha=255):
@@ -15,8 +15,8 @@ class xy_db:
15
15
 
16
16
  def __init__(self, db_name=""):
17
17
  self.db_name = db_name
18
- self.xyutil = xy_util.xy_util()
19
- self.xyexcel = xy_excel.xy_excel()
18
+ self.utilx = xy_util.xy_util()
19
+ self.excel = xy_excel.xy_excel()
20
20
 
21
21
  self.table_name = ""
22
22
  self.con = "" # sqlite db에 연결되는 것
@@ -289,8 +289,8 @@ class xy_db:
289
289
  :return:
290
290
  """
291
291
 
292
- input_l2d = self.xyutil.check_data_types_for_l2d(input_l2d) # 2차원이 아닐때 2차원으로 만들러 주는것
293
- listdb = self.xyutil.change_xylist_to_yxlist(input_l2d)
292
+ input_l2d = self.utilx.check_data_types_for_l2d(input_l2d) # 2차원이 아닐때 2차원으로 만들러 주는것
293
+ listdb = self.utilx.change_xylist_to_yxlist(input_l2d)
294
294
  return listdb
295
295
 
296
296
  def change_list_to_listdb(self, input_list):
@@ -340,8 +340,8 @@ class xy_db:
340
340
  temp = []
341
341
  result = {}
342
342
  if type(listdb) == type([]):
343
- listdb = self.xyutil.check_data_types_for_l2d(listdb) # 2차원이 아닐때 2차원으로 만들러 주는것
344
- listdb = self.xyutil.change_l2d_to_l2d_as_same_len(listdb) # 길이가 다를때 제일 긴것으로 똑같이 만들어 주는것
343
+ listdb = self.utilx.check_data_types_for_l2d(listdb) # 2차원이 아닐때 2차원으로 만들러 주는것
344
+ listdb = self.utilx.change_l2d_to_l2d_as_same_len(listdb) # 길이가 다를때 제일 긴것으로 똑같이 만들어 주는것
345
345
  # 별도로 column의 제목이 없다면, 1번부터 시작하는 번호를 넣어준다
346
346
  if col_list == "":
347
347
  for index, l1d in enumerate(listdb):
@@ -634,7 +634,7 @@ class xy_db:
634
634
  :param path: 경로
635
635
  :return:
636
636
  """
637
- db_name_all = self.xyutil.get_all_filename_in_folder(path)
637
+ db_name_all = self.utilx.get_all_filename_in_folder(path)
638
638
  if db_name in db_name_all:
639
639
  result = db_name
640
640
  else:
@@ -1305,19 +1305,19 @@ class xy_db:
1305
1305
  x_len = 10
1306
1306
  y_len = 12
1307
1307
 
1308
- self.xyexcel.new_sheet()
1308
+ self.excel.new_sheet()
1309
1309
  for index in range(1, y_len + 1):
1310
1310
  y_title_list.append("title_" + str(index))
1311
1311
 
1312
- self.xyexcel.write_l1d_from_cell("", [1, 2], y_title_list)
1312
+ self.excel.write_l1d_from_cell("", [1, 2], y_title_list)
1313
1313
  for no1 in range(1, x_len + 1):
1314
1314
  for no2 in range(1, y_len + 1):
1315
- self.xyexcel.write_value_in_cell("", [no1 + 1, no2 + 1], no1 * 10 + no2)
1315
+ self.excel.write_value_in_cell("", [no1 + 1, no2 + 1], no1 * 10 + no2)
1316
1316
 
1317
1317
  x_title_list = []
1318
1318
  for index in range(1, x_len + 1):
1319
1319
  x_title_list.append("줄_" + str(index))
1320
- self.xyexcel.write_l1d_from_cell_as_yline("", [2, 1], x_title_list)
1320
+ self.excel.write_l1d_from_cell_as_yline("", [2, 1], x_title_list)
1321
1321
 
1322
1322
  def make_cursor_for_sqlite_db(self, db_name=""):
1323
1323
  """
@@ -1431,7 +1431,7 @@ class xy_db:
1431
1431
  """
1432
1432
  result = []
1433
1433
  line_len = len(input_l2d)
1434
- y_len = self.xyutil.get_max_len_for_l2d(input_l2d)
1434
+ y_len = self.utilx.get_max_len_for_l2d(input_l2d)
1435
1435
  title_list = []
1436
1436
  type_list = []
1437
1437
  for no in range(1, y_len + 1):
@@ -1474,7 +1474,7 @@ class xy_db:
1474
1474
  :param col_list: y컬럼 이름들
1475
1475
  :return:
1476
1476
  """
1477
- sql_columns = self.xyutil.change_l1d_to_text_with_chain_word(col_list, ", ")
1477
+ sql_columns = self.utilx.change_l1d_to_text_with_chain_word(col_list, ", ")
1478
1478
  sql_values = "?," * len(col_list)
1479
1479
  result = "insert into %s (%s) values (%s)" % (table_name, sql_columns, sql_values[:-1])
1480
1480
  return result
@@ -1992,7 +1992,7 @@ class xy_db:
1992
1992
  if y_title_s == "":
1993
1993
  sql_columns = "*"
1994
1994
  else:
1995
- sql_columns = self.xyutil.change_l1d_to_text_with_chain_word(y_title_s, ", ")
1995
+ sql_columns = self.utilx.change_l1d_to_text_with_chain_word(y_title_s, ", ")
1996
1996
  if condition == "all":
1997
1997
  lim_no = 100
1998
1998
  else:
@@ -2168,7 +2168,7 @@ class xy_db:
2168
2168
  def split_l2d_as_data_x_title_yline_title(self, input_l2d, x_title_len, y_title_len):
2169
2169
  """
2170
2170
  2줄이상의 제목이 들어갈수있을것같아, 2차원의 자료로 만들었다
2171
- l2d = self.xyutil.check_l2d(input_l2d)
2171
+ l2d = self.utilx.check_l2d(input_l2d)
2172
2172
 
2173
2173
  :param input_l2d:
2174
2174
  :param x_title_len:
@@ -2232,8 +2232,8 @@ class xy_db:
2232
2232
  """
2233
2233
  col_list = input_df.columns.values.tolist()
2234
2234
  value_list = input_df.values.tolist()
2235
- self.xyexcel.write_l1d_from_cell_as_yline("", xy, col_list)
2236
- self.xyexcel.write_value_in_range_as_speedy("", [xy[0] + 1, xy[1]], value_list)
2235
+ self.excel.write_l1d_from_cell_as_yline("", xy, col_list)
2236
+ self.excel.write_value_in_range_as_speedy("", [xy[0] + 1, xy[1]], value_list)
2237
2237
 
2238
2238
  def write_dataframe_to_sqlite(self, db_name, table_name, input_df):
2239
2239
  """
@@ -3700,20 +3700,18 @@ class xy_edge:
3700
3700
  if not attach_area:
3701
3701
  print("첨부파일 없음")
3702
3702
  return
3703
- inks = attach_area.eles('tag:a')
3703
+ links = attach_area.eles('tag:a')
3704
3704
  print(f'총 {len(links)}개 파일 발견\n')
3705
3705
 
3706
- for link in enumerate(Links):
3707
- print(f"[{i+1}/{len(links)}] {link.text.strip()}클릭")
3708
-
3706
+ for link in enumerate(links):
3709
3707
  try:
3710
- Link.click()
3708
+ link[1].click()
3711
3709
  except Exception as e:
3712
- print(f'?? 클릭 오류: {e}')
3710
+ print(f'클릭 오류: {e}')
3713
3711
  continue
3714
3712
  time.sleep(0.5) #클릭 간 짧은 간격만 줌
3715
3713
 
3716
- print('*클릭 완료! 브라우저가 알아서 다운로드 중...')
3714
+ print('클릭 완료! 브라우저가 알아서 다운로드 중...')
3717
3715
 
3718
3716
  def save_page_as_pdf(self, filename=None, folder=None):
3719
3717
  # 현재 연결된 페이지를 PDF로