xython 4.5.3__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.
- {xython-4.5.3/src/xython.egg-info → xython-4.5.4}/PKG-INFO +1 -1
- {xython-4.5.3 → xython-4.5.4}/pyproject.toml +1 -1
- {xython-4.5.3 → xython-4.5.4}/src/xython/xy_color.py +9 -1
- {xython-4.5.3 → xython-4.5.4}/src/xython/xy_edge.py +5 -7
- {xython-4.5.3 → xython-4.5.4}/src/xython/xy_excel.py +124 -116
- {xython-4.5.3 → xython-4.5.4}/src/xython/xy_outlook.py +54 -0
- {xython-4.5.3 → xython-4.5.4/src/xython.egg-info}/PKG-INFO +1 -1
- {xython-4.5.3 → xython-4.5.4}/MANIFEST.in +0 -0
- {xython-4.5.3 → xython-4.5.4}/README.md +0 -0
- {xython-4.5.3 → xython-4.5.4}/requirements.txt +0 -0
- {xython-4.5.3 → xython-4.5.4}/setup.cfg +0 -0
- {xython-4.5.3 → xython-4.5.4}/src/xython/__init__.py +0 -0
- {xython-4.5.3 → xython-4.5.4}/src/xython/_easy_start.py +0 -0
- {xython-4.5.3 → xython-4.5.4}/src/xython/xy_auto.py +0 -0
- {xython-4.5.3 → xython-4.5.4}/src/xython/xy_chrome.py +0 -0
- {xython-4.5.3 → xython-4.5.4}/src/xython/xy_common.py +0 -0
- {xython-4.5.3 → xython-4.5.4}/src/xython/xy_db.py +0 -0
- {xython-4.5.3 → xython-4.5.4}/src/xython/xy_excel_event.py +0 -0
- {xython-4.5.3 → xython-4.5.4}/src/xython/xy_hwp.py +0 -0
- {xython-4.5.3 → xython-4.5.4}/src/xython/xy_list.py +0 -0
- {xython-4.5.3 → xython-4.5.4}/src/xython/xy_map.py +0 -0
- {xython-4.5.3 → xython-4.5.4}/src/xython/xy_re.py +0 -0
- {xython-4.5.3 → xython-4.5.4}/src/xython/xy_time.py +0 -0
- {xython-4.5.3 → xython-4.5.4}/src/xython/xy_util.py +0 -0
- {xython-4.5.3 → xython-4.5.4}/src/xython/xy_word.py +0 -0
- {xython-4.5.3 → xython-4.5.4}/src/xython.egg-info/SOURCES.txt +0 -0
- {xython-4.5.3 → xython-4.5.4}/src/xython.egg-info/dependency_links.txt +0 -0
- {xython-4.5.3 → xython-4.5.4}/src/xython.egg-info/requires.txt +0 -0
- {xython-4.5.3 → xython-4.5.4}/src/xython.egg-info/top_level.txt +0 -0
|
@@ -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:
|
|
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):
|
|
@@ -3700,20 +3700,18 @@ class xy_edge:
|
|
|
3700
3700
|
if not attach_area:
|
|
3701
3701
|
print("첨부파일 없음")
|
|
3702
3702
|
return
|
|
3703
|
-
|
|
3703
|
+
links = attach_area.eles('tag:a')
|
|
3704
3704
|
print(f'총 {len(links)}개 파일 발견\n')
|
|
3705
3705
|
|
|
3706
|
-
for link in enumerate(
|
|
3707
|
-
print(f"[{i+1}/{len(links)}] {link.text.strip()}클릭")
|
|
3708
|
-
|
|
3706
|
+
for link in enumerate(links):
|
|
3709
3707
|
try:
|
|
3710
|
-
|
|
3708
|
+
link[1].click()
|
|
3711
3709
|
except Exception as e:
|
|
3712
|
-
print(f'
|
|
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로
|
|
@@ -741,7 +741,7 @@ class xy_excel:
|
|
|
741
741
|
result = {}
|
|
742
742
|
|
|
743
743
|
for index, l1d in enumerate(l2d):
|
|
744
|
-
temp =
|
|
744
|
+
temp = ''
|
|
745
745
|
for sero in input_l1d:
|
|
746
746
|
temp = temp + str(l1d[sero - 1]) + "_" # 세로의 자료들을 _로 다 연결한다
|
|
747
747
|
temp = temp[:-1]
|
|
@@ -808,7 +808,7 @@ class xy_excel:
|
|
|
808
808
|
주소록의 각 자료를 찾는 방법으로, 고유한 이름을 기준으로 ID를 리스트로 저장하는 것이다
|
|
809
809
|
제일앞의 것이 id이다
|
|
810
810
|
"""
|
|
811
|
-
l2d = self.read(
|
|
811
|
+
l2d = self.read('', xyxy)
|
|
812
812
|
result = {}
|
|
813
813
|
for l1d in l2d:
|
|
814
814
|
for no in range(len(l1d), 0, -1):
|
|
@@ -1237,7 +1237,7 @@ class xy_excel:
|
|
|
1237
1237
|
for aa in zz:
|
|
1238
1238
|
try:
|
|
1239
1239
|
pswd = "".join(aa)
|
|
1240
|
-
self.sheet_lock(
|
|
1240
|
+
self.sheet_lock('', pswd)
|
|
1241
1241
|
return
|
|
1242
1242
|
except:
|
|
1243
1243
|
pass
|
|
@@ -1251,7 +1251,7 @@ class xy_excel:
|
|
|
1251
1251
|
base_value = ""
|
|
1252
1252
|
xy = self.get_address_for_activecell()
|
|
1253
1253
|
for no in input_list:
|
|
1254
|
-
base_value = base_value + str(self.read_at_cell(
|
|
1254
|
+
base_value = base_value + str(self.read_at_cell('', [xy[0], no]))
|
|
1255
1255
|
|
|
1256
1256
|
# 혹시 1보다 작은 숫자가 나올 수있으므로, 최소시작점을 1로하기위해
|
|
1257
1257
|
start_x = max(int(xy[0]) - check_line, 1)
|
|
@@ -1260,10 +1260,10 @@ class xy_excel:
|
|
|
1260
1260
|
for no in range(start_x, start_x + 20):
|
|
1261
1261
|
one_value = ""
|
|
1262
1262
|
for one in input_list:
|
|
1263
|
-
one_value = one_value + str(self.read_at_cell(
|
|
1263
|
+
one_value = one_value + str(self.read_at_cell('', [no, one]))
|
|
1264
1264
|
if base_value == one_value:
|
|
1265
1265
|
# 보통 50개이상의 줄을 사용하지 않으므로 50개를 갖고온다
|
|
1266
|
-
temp = self.read(
|
|
1266
|
+
temp = self.read('', [no, 1, no, 50])
|
|
1267
1267
|
result.append(temp[0])
|
|
1268
1268
|
return result
|
|
1269
1269
|
|
|
@@ -1276,7 +1276,7 @@ class xy_excel:
|
|
|
1276
1276
|
- 2번 : 뒤의 자료중 다른 것
|
|
1277
1277
|
영역을 나타내는 xyxy1또는 xyxy2 변수의 기본값을 ""일때는 현재 선택된 영역을 뜻하는 것입니다
|
|
1278
1278
|
"""
|
|
1279
|
-
sheet = self.check_sheet_name(
|
|
1279
|
+
sheet = self.check_sheet_name('')
|
|
1280
1280
|
data1 = self.read(sheet_name, xyxy1)
|
|
1281
1281
|
data2 = self.read(sheet_name, xyxy2)
|
|
1282
1282
|
|
|
@@ -1296,16 +1296,16 @@ class xy_excel:
|
|
|
1296
1296
|
|
|
1297
1297
|
self.new_sheet()
|
|
1298
1298
|
sheet.Cells(1, 1).Value = "2 영역중 같은것"
|
|
1299
|
-
self.write_l2d_from_cell(
|
|
1299
|
+
self.write_l2d_from_cell('', [2, 1], data1_found)
|
|
1300
1300
|
|
|
1301
1301
|
line2_start = len(data1_found) + 5
|
|
1302
1302
|
sheet.Cells(line2_start - 1, 1).Value = "비교자료중 못찾은 것 (앞의 자료)"
|
|
1303
|
-
self.write_l2d_from_cell(
|
|
1303
|
+
self.write_l2d_from_cell('', [line2_start, 1], data1_not_found)
|
|
1304
1304
|
|
|
1305
1305
|
line3_start = line2_start + len(data1_not_found) + 5
|
|
1306
1306
|
|
|
1307
1307
|
sheet.Cells(line3_start - 1, 1).Value = "결과가 중요한 것중 못찾은 것 (뒷 자료)"
|
|
1308
|
-
self.write_l2d_from_cell(
|
|
1308
|
+
self.write_l2d_from_cell('', [line3_start, 1], data2_not_found)
|
|
1309
1309
|
|
|
1310
1310
|
def check_sheet_n_xyxy(self, sheet_name='', xyxy=''):
|
|
1311
1311
|
"""
|
|
@@ -1325,7 +1325,7 @@ class xy_excel:
|
|
|
1325
1325
|
#1 : 현재 워크북의 순번에 따른 시트객체를 갖고온다
|
|
1326
1326
|
"""
|
|
1327
1327
|
|
|
1328
|
-
if sheet_name is None or sheet_name == "": # None이거나 빈 문자열(
|
|
1328
|
+
if sheet_name is None or sheet_name == "": # None이거나 빈 문자열('')이이 바로 리턴 (가장 빠름)
|
|
1329
1329
|
return self.xlbook.ActiveSheet
|
|
1330
1330
|
elif isinstance(sheet_name, str): # 문자열 처리
|
|
1331
1331
|
if sheet_name.lower() in ("activesheet", "active_sheet"):
|
|
@@ -1451,6 +1451,8 @@ class xy_excel:
|
|
|
1451
1451
|
self.xlapp.Quit()
|
|
1452
1452
|
except Exception as e:
|
|
1453
1453
|
print(f"[WARN] Excel Quit 실패: {e}")
|
|
1454
|
+
self.xlbook = None
|
|
1455
|
+
self.xlapp = None
|
|
1454
1456
|
if force:
|
|
1455
1457
|
self.check_excel_program()
|
|
1456
1458
|
else:
|
|
@@ -1481,10 +1483,10 @@ class xy_excel:
|
|
|
1481
1483
|
for y in range(y_len):
|
|
1482
1484
|
temp = ""
|
|
1483
1485
|
for x in range(x_len):
|
|
1484
|
-
self.write_at_cell(
|
|
1486
|
+
self.write_at_cell('', [x + xy[0], y + xy[1]], "")
|
|
1485
1487
|
if input_list_2d[x][y]:
|
|
1486
1488
|
temp = temp + " " + input_list_2d[x][y]
|
|
1487
|
-
self.write_at_cell(
|
|
1489
|
+
self.write_at_cell('', [xy[0], y + xy[1]], str(temp).strip())
|
|
1488
1490
|
|
|
1489
1491
|
def conditional_format_by_cell_value(self, sheet_name, xyxy, input_color="yel70", start_xy=[3, 5], input_value="입력값12", cf_no=None):
|
|
1490
1492
|
"""
|
|
@@ -1515,7 +1517,7 @@ class xy_excel:
|
|
|
1515
1517
|
"""
|
|
1516
1518
|
조건부서식 : 함수사용
|
|
1517
1519
|
|
|
1518
|
-
conditional_format_with_function(
|
|
1520
|
+
conditional_format_with_function('', [1, 1, 7, 7], "=LEN(TRIM($A1))=0")
|
|
1519
1521
|
만약 형태를 바꾸고 싶으면 setup을 먼저 이용해서 형태를 설정합니다
|
|
1520
1522
|
|
|
1521
1523
|
"""
|
|
@@ -1574,7 +1576,7 @@ class xy_excel:
|
|
|
1574
1576
|
def conditional_format_by_operator(self, sheet_name='', xyxy='', operator="100<=value<200", range_format="red50", type="value"):
|
|
1575
1577
|
"""
|
|
1576
1578
|
조건부서식 사용하기
|
|
1577
|
-
conditional_format_with_operator(
|
|
1579
|
+
conditional_format_with_operator('', [1, 1, 7, 7], "100<=value <200")
|
|
1578
1580
|
만약 형태를 바꾸고 싶으면 setup을 먼저 이용해서 형태를 설정합니다
|
|
1579
1581
|
"""
|
|
1580
1582
|
type_dic = {"AboveAverageCondition": 12, "BlanksCondition": 10,
|
|
@@ -1678,7 +1680,7 @@ class xy_excel:
|
|
|
1678
1680
|
현재 선택된 영역을 클립보드에 복사합니다.
|
|
1679
1681
|
|
|
1680
1682
|
|
|
1681
|
-
excel.select_range(
|
|
1683
|
+
excel.select_range('', "A1:B10")
|
|
1682
1684
|
excel.copy()
|
|
1683
1685
|
"""
|
|
1684
1686
|
sheet, [x1, y1, x2, y2], rng = self.check_sheet_n_xyxy(sheet_name, xyxy)
|
|
@@ -2040,7 +2042,7 @@ class xy_excel:
|
|
|
2040
2042
|
for x, y in itertools.product(range(x1, x2 + 1), range(y1, y2 + 1)):
|
|
2041
2043
|
value = sheet.Cells(x, y).Value
|
|
2042
2044
|
if isinstance(value, str):
|
|
2043
|
-
value = value.replace(
|
|
2045
|
+
value = value.replace('', "")
|
|
2044
2046
|
sheet.Cells(x, y).Value = value
|
|
2045
2047
|
|
|
2046
2048
|
def delete_all_textbox_for_sheet(self, sheet_name=''):
|
|
@@ -2774,7 +2776,7 @@ class xy_excel:
|
|
|
2774
2776
|
"""
|
|
2775
2777
|
sheet, [x1, y1, x2, y2], rng = self.check_sheet_n_xyxy(sheet_name, xyxy)
|
|
2776
2778
|
for x, y in itertools.product(range(x1, x2 + 1), range(y1, y2 + 1)):
|
|
2777
|
-
value = self.read_at_cell(
|
|
2779
|
+
value = self.read_at_cell('', [x, y])
|
|
2778
2780
|
if isinstance(value, str):
|
|
2779
2781
|
changed_value = self.rex.delete_num_comma(value)
|
|
2780
2782
|
sheet.Cells(x, y).Value = changed_value
|
|
@@ -3095,14 +3097,21 @@ class xy_excel:
|
|
|
3095
3097
|
del input_l2d[x][one]
|
|
3096
3098
|
return input_l2d
|
|
3097
3099
|
|
|
3098
|
-
def delete_yyline(self, sheet_name='',
|
|
3099
|
-
"""
|
|
3100
|
-
|
|
3101
|
-
"""
|
|
3100
|
+
def delete_yyline(self, sheet_name='', yy_list=None):
|
|
3102
3101
|
[sheet_name, xyxy, yy_list] = self._check_3_param(sheet_name, xyxy, yy_list)
|
|
3103
3102
|
sheet, [x1, y1, x2, y2], rng = self.check_sheet_n_xyxy(sheet_name, xyxy)
|
|
3104
3103
|
y1, y2 = self.check_yy_address(yy_list)
|
|
3105
|
-
sheet.Columns(y1 + ':' +
|
|
3104
|
+
sheet.Columns(y1 + ':' + y2).Delete()
|
|
3105
|
+
|
|
3106
|
+
def delete_yyline_in_range(self, sheet_name='', xyxy='', yy_list=None):
|
|
3107
|
+
[sheet_name, xyxy, yy_list] = self._check_3_param(sheet_name, xyxy, yy_list)
|
|
3108
|
+
sheet, [x1, y1, x2, y2], rng = self.check_sheet_n_xyxy(sheet_name, xyxy)
|
|
3109
|
+
|
|
3110
|
+
y1 = max(y1, yy_list[0])
|
|
3111
|
+
y2 = min(y2, yy_list[1])
|
|
3112
|
+
|
|
3113
|
+
y1_char, y2_char = self.check_yy_address([y1, y2])
|
|
3114
|
+
sheet.Columns(y1_char + ':' + y2_char).Delete()
|
|
3106
3115
|
|
|
3107
3116
|
def divide_1_area_to_3_area(self, xyxy, top_line_no=0, bottom_line_no=0):
|
|
3108
3117
|
"""
|
|
@@ -3498,13 +3507,13 @@ class xy_excel:
|
|
|
3498
3507
|
|
|
3499
3508
|
"""
|
|
3500
3509
|
self.xlbook.Windows(1).FreezePanes = False
|
|
3501
|
-
x1, y1, x2, y2 = self.change_address_to_xyxy(
|
|
3510
|
+
x1, y1, x2, y2 = self.change_address_to_xyxy('')
|
|
3502
3511
|
if y1 == 0:
|
|
3503
|
-
self.select_xxline_in_range(
|
|
3512
|
+
self.select_xxline_in_range('', x1)
|
|
3504
3513
|
elif x1 == 0:
|
|
3505
|
-
self.select_yyline_in_range(
|
|
3514
|
+
self.select_yyline_in_range('', y1)
|
|
3506
3515
|
else:
|
|
3507
|
-
self.select_at_cell(
|
|
3516
|
+
self.select_at_cell('', [x1, y1])
|
|
3508
3517
|
self.xlbook.Windows(1).FreezePanes = True
|
|
3509
3518
|
|
|
3510
3519
|
def freeze_pane_at_xline(self, sheet_name, input_xno):
|
|
@@ -3571,7 +3580,7 @@ class xy_excel:
|
|
|
3571
3580
|
"""
|
|
3572
3581
|
|
|
3573
3582
|
"""
|
|
3574
|
-
self.freeze_pane_for_yline_for_sheet(
|
|
3583
|
+
self.freeze_pane_for_yline_for_sheet('', input_yno)
|
|
3575
3584
|
|
|
3576
3585
|
def freeze_pane_for_yline_for_sheet(self, sheet_name, input_yno):
|
|
3577
3586
|
"""
|
|
@@ -4786,14 +4795,14 @@ class xy_excel:
|
|
|
4786
4795
|
2) 최종적으로 같은것은 새로운 시트에 써준다
|
|
4787
4796
|
|
|
4788
4797
|
"""
|
|
4789
|
-
sheet = self.check_sheet_name(
|
|
4790
|
-
base_l2d = self.read(
|
|
4798
|
+
sheet = self.check_sheet_name('')
|
|
4799
|
+
base_l2d = self.read('', xyxy1)
|
|
4791
4800
|
base_l1d = self.utilx.change_l2d_to_l1d(base_l2d) # 비교를 위하여 1차원자료로 만든것
|
|
4792
4801
|
same_data = []
|
|
4793
4802
|
rgbint = self.colorx.to_rgbint("red80")
|
|
4794
4803
|
x1, y1, x2, y2 = self.change_address_to_xyxy(xyxy2)
|
|
4795
4804
|
for x, y in itertools.product(range(x1, x2 + 1), range(y1, y2 + 1)):
|
|
4796
|
-
one_value = self.read_at_cell(
|
|
4805
|
+
one_value = self.read_at_cell('', [x, y])
|
|
4797
4806
|
if one_value:
|
|
4798
4807
|
if one_value in base_l1d:
|
|
4799
4808
|
same_data.append(one_value)
|
|
@@ -4801,7 +4810,7 @@ class xy_excel:
|
|
|
4801
4810
|
|
|
4802
4811
|
self.new_sheet()
|
|
4803
4812
|
sheet.Cells(1, 1).Value = "동일한 값입니다"
|
|
4804
|
-
self.write_l1d_from_cell_as_yline(
|
|
4813
|
+
self.write_l1d_from_cell_as_yline('', [1, 2], same_data)
|
|
4805
4814
|
return 1
|
|
4806
4815
|
|
|
4807
4816
|
def get_selection_obj(self):
|
|
@@ -4928,7 +4937,7 @@ class xy_excel:
|
|
|
4928
4937
|
현재 활성화된 시트를 객체형식으로 돌려주는 것
|
|
4929
4938
|
|
|
4930
4939
|
"""
|
|
4931
|
-
return self.check_sheet_name(
|
|
4940
|
+
return self.check_sheet_name('')
|
|
4932
4941
|
|
|
4933
4942
|
def get_sheet_hwnd(self, excel_hwnd):
|
|
4934
4943
|
"""
|
|
@@ -5726,7 +5735,7 @@ class xy_excel:
|
|
|
5726
5735
|
count = 0
|
|
5727
5736
|
for a in itertools.product(source_letter, repeat=repeat_no):
|
|
5728
5737
|
count += 1
|
|
5729
|
-
temp_pwd = (
|
|
5738
|
+
temp_pwd = (''.os.path.join(map(str, a)))
|
|
5730
5739
|
try:
|
|
5731
5740
|
self.set_sheet_lock_off(sheet_name, temp_pwd)
|
|
5732
5741
|
except:
|
|
@@ -5773,11 +5782,11 @@ class xy_excel:
|
|
|
5773
5782
|
sheet, [x1, y1, x2, y2], rng = self.check_sheet_n_xyxy(sheet_name, xyxy)
|
|
5774
5783
|
l2d = self.read_range()
|
|
5775
5784
|
self.new_sheet()
|
|
5776
|
-
self.write_at_cell(
|
|
5785
|
+
self.write_at_cell('', [1, 1], "[")
|
|
5777
5786
|
for ix, l1d in enumerate(l2d[:-1]):
|
|
5778
|
-
self.write_at_cell(
|
|
5779
|
-
self.write_at_cell(
|
|
5780
|
-
self.write_at_cell(
|
|
5787
|
+
self.write_at_cell('', [ix + 2, 1], str(l1d) + ",")
|
|
5788
|
+
self.write_at_cell('', [len(l2d) + 1, 1], str(l2d[-1]) + ",")
|
|
5789
|
+
self.write_at_cell('', [len(l2d) + 2, 1], "]")
|
|
5781
5790
|
|
|
5782
5791
|
def make_line_for_splitted_data(self, xyxy, union_char="#"):
|
|
5783
5792
|
"""
|
|
@@ -5785,12 +5794,12 @@ class xy_excel:
|
|
|
5785
5794
|
맨앞의 자료 1줄만 합친다
|
|
5786
5795
|
|
|
5787
5796
|
"""
|
|
5788
|
-
sheet = self.check_sheet_name(
|
|
5797
|
+
sheet = self.check_sheet_name('')
|
|
5789
5798
|
temp = ""
|
|
5790
5799
|
old_x = xyxy[0]
|
|
5791
5800
|
for x in range(xyxy[0], xyxy[2] + 1):
|
|
5792
|
-
gijun_data = self.read_at_cell(
|
|
5793
|
-
value = self.read_at_cell(
|
|
5801
|
+
gijun_data = self.read_at_cell('', [x, xyxy[1]])
|
|
5802
|
+
value = self.read_at_cell('', [x, xyxy[1] + 1])
|
|
5794
5803
|
|
|
5795
5804
|
if gijun_data:
|
|
5796
5805
|
sheet.Cells(old_x, xyxy[1] + 2).Value = temp[:-len(union_char)]
|
|
@@ -5816,9 +5825,9 @@ class xy_excel:
|
|
|
5816
5825
|
# 한번 붙여넣기를 하면 없어져서, 계속 해야한다
|
|
5817
5826
|
no = no + 1
|
|
5818
5827
|
xl2 = xy_excel("new")
|
|
5819
|
-
xl2.paste_format_only(
|
|
5820
|
-
xl2.write_l1d(
|
|
5821
|
-
xl2.write_l2d(
|
|
5828
|
+
xl2.paste_format_only('', [1, 1])
|
|
5829
|
+
xl2.write_l1d('', [1, 1], l2d[0])
|
|
5830
|
+
xl2.write_l2d('', [1, 1], l2d_group[index + 1])
|
|
5822
5831
|
xl2.save(filename + str(no) + ".xlsx")
|
|
5823
5832
|
xl2.close()
|
|
5824
5833
|
|
|
@@ -5913,7 +5922,7 @@ class xy_excel:
|
|
|
5913
5922
|
다른곳에 부분적으로 같은 이름이 있을수있다
|
|
5914
5923
|
|
|
5915
5924
|
"""
|
|
5916
|
-
l2d = self.read(
|
|
5925
|
+
l2d = self.read('', xyxy)
|
|
5917
5926
|
result = []
|
|
5918
5927
|
x_line_no = len(l2d)
|
|
5919
5928
|
y_line_no = len(l2d[0])
|
|
@@ -5924,7 +5933,7 @@ class xy_excel:
|
|
|
5924
5933
|
for x in range(x_line_no):
|
|
5925
5934
|
# 값이 없으면, None값으로 넣는다
|
|
5926
5935
|
if l2d[x][y] == "" or l2d[x][y] == None:
|
|
5927
|
-
new_no.append(
|
|
5936
|
+
new_no.append('')
|
|
5928
5937
|
else:
|
|
5929
5938
|
if x == 0:
|
|
5930
5939
|
new_no = [change_start_no, ]
|
|
@@ -5973,7 +5982,7 @@ class xy_excel:
|
|
|
5973
5982
|
self.xlapp.DisplayAlerts = False
|
|
5974
5983
|
|
|
5975
5984
|
for no in range(x1, x2 + 1):
|
|
5976
|
-
l2d = self.read(
|
|
5985
|
+
l2d = self.read('', [no, y1, no, y2])
|
|
5977
5986
|
for one_value in l2d[0]:
|
|
5978
5987
|
if one_value:
|
|
5979
5988
|
temp_text = temp_text + str(one_value) + " "
|
|
@@ -5989,7 +5998,7 @@ class xy_excel:
|
|
|
5989
5998
|
sheet, [x1, y1, x2, y2], rng = self.check_sheet_n_xyxy(sheet_name, xyxy)
|
|
5990
5999
|
self.xlapp.DisplayAlerts = False
|
|
5991
6000
|
for no in range(x1, x2 + 1):
|
|
5992
|
-
l2d = self.read(
|
|
6001
|
+
l2d = self.read('', [no, y1, no, y2])
|
|
5993
6002
|
for one_value in l2d[0]:
|
|
5994
6003
|
if one_value:
|
|
5995
6004
|
temp_text = temp_text + str(one_value) + " "
|
|
@@ -6007,7 +6016,7 @@ class xy_excel:
|
|
|
6007
6016
|
sheet, [x1, y1, x2, y2], rng = self.check_sheet_n_xyxy(sheet_name, xyxy)
|
|
6008
6017
|
x1, y1, x2, y2 = self.get_address_for_selection()
|
|
6009
6018
|
for x in range(x1, x2 + 1):
|
|
6010
|
-
self.merge_range(
|
|
6019
|
+
self.merge_range('', [x, y1, x, y2])
|
|
6011
6020
|
|
|
6012
6021
|
def merge_left_2_yline(self, sheet_name='', xyxy=''):
|
|
6013
6022
|
"""
|
|
@@ -6082,7 +6091,7 @@ class xy_excel:
|
|
|
6082
6091
|
for idx in new_col_indices:
|
|
6083
6092
|
merged_data[0].append(header2[idx])
|
|
6084
6093
|
for row_idx in range(1, len(merged_data)):
|
|
6085
|
-
merged_data[row_idx].append(
|
|
6094
|
+
merged_data[row_idx].append('')
|
|
6086
6095
|
col_mapping[idx] = len(merged_data[0])
|
|
6087
6096
|
total_cols = len(merged_data[0])
|
|
6088
6097
|
|
|
@@ -6167,8 +6176,8 @@ class xy_excel:
|
|
|
6167
6176
|
y라인의 가로 한줄의 자료를 여반복갯수에 따라서 시작점에서부터 아래로 복사하는것
|
|
6168
6177
|
|
|
6169
6178
|
"""
|
|
6170
|
-
sheet = self.check_sheet_name(
|
|
6171
|
-
all_data_set = self.read(
|
|
6179
|
+
sheet = self.check_sheet_name('')
|
|
6180
|
+
all_data_set = self.read('', xyxy)
|
|
6172
6181
|
for no in range(len(all_data_set)):
|
|
6173
6182
|
mok, namuji = divmod(no, repeat_no)
|
|
6174
6183
|
new_x = mok + start_xy[0]
|
|
@@ -6450,9 +6459,9 @@ class xy_excel:
|
|
|
6450
6459
|
|
|
6451
6460
|
"""
|
|
6452
6461
|
sheet, [x1, y1, x2, y2], rng = self.check_sheet_n_xyxy(sheet_name, xyxy)
|
|
6453
|
-
self.insert_yline(
|
|
6462
|
+
self.insert_yline('', y1)
|
|
6454
6463
|
for one_x in range(x1, x2):
|
|
6455
|
-
one_value = self.read_at_cell(
|
|
6464
|
+
one_value = self.read_at_cell('', [one_x, y1 + 1])
|
|
6456
6465
|
if one_value.startswith(startwith):
|
|
6457
6466
|
sheet.Cells(one_x, y1).Value = one_value
|
|
6458
6467
|
sheet.Cells(one_x, y1 + 1).Value = None
|
|
@@ -6495,11 +6504,11 @@ class xy_excel:
|
|
|
6495
6504
|
셀의 값중에 입력으로 들어간 글자가 맨앞부분에 있으면, 한칸 앞으로 옮기기
|
|
6496
6505
|
|
|
6497
6506
|
"""
|
|
6498
|
-
sheet = self.check_sheet_name(
|
|
6507
|
+
sheet = self.check_sheet_name('')
|
|
6499
6508
|
x, y, x2, y2 = self.get_address_for_selection()
|
|
6500
|
-
self.insert_yline(
|
|
6509
|
+
self.insert_yline('', y)
|
|
6501
6510
|
for one_x in range(x, x2):
|
|
6502
|
-
one_value = self.read_at_cell(
|
|
6511
|
+
one_value = self.read_at_cell('', [one_x, y + 1])
|
|
6503
6512
|
if one_value.startswith(input_value):
|
|
6504
6513
|
sheet.Cells(one_x, y).Value = one_value
|
|
6505
6514
|
sheet.Cells(one_x, y + 1).Value = None
|
|
@@ -6582,8 +6591,8 @@ class xy_excel:
|
|
|
6582
6591
|
입력자료 : 1줄의 영역, 반복하는 갯수, 자료가 옮겨갈 시작주소
|
|
6583
6592
|
|
|
6584
6593
|
"""
|
|
6585
|
-
sheet = self.check_sheet_name(
|
|
6586
|
-
all_data_set = self.read(
|
|
6594
|
+
sheet = self.check_sheet_name('')
|
|
6595
|
+
all_data_set = self.read('', xyxy)
|
|
6587
6596
|
for no in range(len(all_data_set)):
|
|
6588
6597
|
mok, namuji = divmod(no, repeat_no)
|
|
6589
6598
|
new_x = mok + start_xy[0]
|
|
@@ -6681,7 +6690,7 @@ class xy_excel:
|
|
|
6681
6690
|
|
|
6682
6691
|
new_btn = sheet.Buttons()
|
|
6683
6692
|
sheet.Cells(x1, y1).Select()
|
|
6684
|
-
left_px, top_px, width_px, height_px = self.get_coord_at_cell(
|
|
6693
|
+
left_px, top_px, width_px, height_px = self.get_coord_at_cell('', [x1, y1])
|
|
6685
6694
|
new_btn.Add(left_px, top_px, width_px, height_px)
|
|
6686
6695
|
new_btn.OnAction = macro_code
|
|
6687
6696
|
new_btn.Text = title
|
|
@@ -6696,7 +6705,7 @@ class xy_excel:
|
|
|
6696
6705
|
|
|
6697
6706
|
sheet = self.check_sheet_name(sheet_name)
|
|
6698
6707
|
new_btn = sheet.Buttons()
|
|
6699
|
-
left_px, top_px, width_px, height_px = self.get_coord_at_cell(
|
|
6708
|
+
left_px, top_px, width_px, height_px = self.get_coord_at_cell('', xyxy)
|
|
6700
6709
|
new_btn.Add(left_px, top_px, width_px, height_px)
|
|
6701
6710
|
new_btn.OnAction = macro_name
|
|
6702
6711
|
new_btn.Text = title
|
|
@@ -6751,8 +6760,8 @@ class xy_excel:
|
|
|
6751
6760
|
|
|
6752
6761
|
rng.Select()
|
|
6753
6762
|
self.xlapp.selection.Copy()
|
|
6754
|
-
self.new_workbook_with_file_path(
|
|
6755
|
-
sheet = self.check_sheet_name(
|
|
6763
|
+
self.new_workbook_with_file_path('')
|
|
6764
|
+
sheet = self.check_sheet_name('')
|
|
6756
6765
|
sheet.Cells(1, 1).Select()
|
|
6757
6766
|
sheet.Paste()
|
|
6758
6767
|
self.save(input_filename)
|
|
@@ -6858,7 +6867,7 @@ class xy_excel:
|
|
|
6858
6867
|
for index in range(min_count):
|
|
6859
6868
|
one_file = all_files[index]
|
|
6860
6869
|
# insert_all_image_of_folder_for_sheet(self, folder_name, ext_list, xywh, link=0J, image_in_file=1):
|
|
6861
|
-
self.new_images_in_folder(
|
|
6870
|
+
self.new_images_in_folder('', "D:\\", ["jpg"]) # 5
|
|
6862
6871
|
|
|
6863
6872
|
def new_image_name_for_sheet(self, sheet_name, folder_path="D:\\aaa.xlsx", ext_list=["jgp", "png"]):
|
|
6864
6873
|
"""
|
|
@@ -6890,7 +6899,7 @@ class xy_excel:
|
|
|
6890
6899
|
for index in range(min_count):
|
|
6891
6900
|
one_file = all_files[index]
|
|
6892
6901
|
# insert_all_image_of_folder_for_sheet(self, sheet_name, folder_name, ext_list, xywh, link=0J, image_in_file=1):
|
|
6893
|
-
self.new_images_for_sheet_for_folder(
|
|
6902
|
+
self.new_images_for_sheet_for_folder('', "D:\\", ["jpg"]) # 5
|
|
6894
6903
|
|
|
6895
6904
|
def new_images_for_sheet_for_folder(self, sheet_name, folder_name="D:\\aaa", ext_list=["xls"], input_xywh=[3, 3, 20, 30], link="0J", image_in_file=1):
|
|
6896
6905
|
"""
|
|
@@ -7010,8 +7019,8 @@ class xy_excel:
|
|
|
7010
7019
|
temp = ""
|
|
7011
7020
|
old_x = x1
|
|
7012
7021
|
for x in range(x1, x2 + 1):
|
|
7013
|
-
gijun_data = self.read_at_cell(
|
|
7014
|
-
value = self.read_at_cell(
|
|
7022
|
+
gijun_data = self.read_at_cell('', [x, y1])
|
|
7023
|
+
value = self.read_at_cell('', [x, y1 + 1])
|
|
7015
7024
|
|
|
7016
7025
|
if gijun_data:
|
|
7017
7026
|
sheet.Cells(old_x, y1 + 2).Value = temp[:-len(union_char)]
|
|
@@ -7332,7 +7341,7 @@ class xy_excel:
|
|
|
7332
7341
|
|
|
7333
7342
|
"""
|
|
7334
7343
|
for one in range(input_no):
|
|
7335
|
-
self.new_sheet_with_name(
|
|
7344
|
+
self.new_sheet_with_name('')
|
|
7336
7345
|
|
|
7337
7346
|
def new_textbox_at_pxyxy(self, sheet_name, x=3, y=7, width_float=12.4, height_float=8.8, text="입력값1"):
|
|
7338
7347
|
"""
|
|
@@ -7749,7 +7758,7 @@ class xy_excel:
|
|
|
7749
7758
|
|
|
7750
7759
|
"""
|
|
7751
7760
|
sheet, [x1, y1, x2, y2], rng = self.check_sheet_n_xyxy(sheet_name, xyxy)
|
|
7752
|
-
sheet = self.check_sheet_name(
|
|
7761
|
+
sheet = self.check_sheet_name('')
|
|
7753
7762
|
rgbint = self.colorx.change_any_color_to_rgbint("red++")
|
|
7754
7763
|
result = []
|
|
7755
7764
|
for l1d, ix in enumerate(input_l2d_1):
|
|
@@ -7792,7 +7801,7 @@ class xy_excel:
|
|
|
7792
7801
|
|
|
7793
7802
|
"""
|
|
7794
7803
|
self.new_sheet()
|
|
7795
|
-
sheet = self.check_sheet_name(
|
|
7804
|
+
sheet = self.check_sheet_name('')
|
|
7796
7805
|
for ix, one_rgb in rgb_set:
|
|
7797
7806
|
sheet.Cells(xy_list[0] + ix, xy_list[1]).Interior.Color = self.colorx.rgb_to_rgbint(one_rgb)
|
|
7798
7807
|
|
|
@@ -8243,7 +8252,7 @@ class xy_excel:
|
|
|
8243
8252
|
|
|
8244
8253
|
"""
|
|
8245
8254
|
xyxy = self.get_address_for_activecell()
|
|
8246
|
-
value = self.read_at_cell(
|
|
8255
|
+
value = self.read_at_cell('', [xyxy[0], input_yno])
|
|
8247
8256
|
value = self.check_input_data(value)
|
|
8248
8257
|
return value
|
|
8249
8258
|
|
|
@@ -8563,7 +8572,7 @@ class xy_excel:
|
|
|
8563
8572
|
"""
|
|
8564
8573
|
현재 시트의 한줄을 읽어와서, 다른시트에 값을 넣는 경우
|
|
8565
8574
|
"""
|
|
8566
|
-
sheet = self.check_sheet_name(
|
|
8575
|
+
sheet = self.check_sheet_name('')
|
|
8567
8576
|
one_list = self.read_as_l1d_for_xline_base(sheet_name, input_xno)[0]
|
|
8568
8577
|
input_l2d = self.utilx.change_any_data_to_l2d(input_l2d)
|
|
8569
8578
|
for l1d in input_l2d:
|
|
@@ -8905,7 +8914,7 @@ class xy_excel:
|
|
|
8905
8914
|
가끔 맨 앞글자만 바꾸고 싶을때가 있다
|
|
8906
8915
|
그럴때 사용하는 것으로, 한번에 여러개도 가능하도록 만들었다
|
|
8907
8916
|
|
|
8908
|
-
사용법 : change_first_char(
|
|
8917
|
+
사용법 : change_first_char('', [1,1,100,1], [["'", ""], ["*", ""], [" ", ""],])
|
|
8909
8918
|
|
|
8910
8919
|
"""
|
|
8911
8920
|
self.replace_first_char(sheet_name, xyxy, input_l2d)
|
|
@@ -8914,7 +8923,7 @@ class xy_excel:
|
|
|
8914
8923
|
"""
|
|
8915
8924
|
가끔 맨 뒷글자만 바꾸고 싶을때가 있다
|
|
8916
8925
|
그럴때 사용하는 것으로, 한번에 여러개도 가능하도록 만들었다
|
|
8917
|
-
사용법 : (
|
|
8926
|
+
사용법 : ('', [1,1,100,1], [["'", ""], ["*", ""], [" ", ""],])
|
|
8918
8927
|
|
|
8919
8928
|
"""
|
|
8920
8929
|
self.replace_last_char(sheet_name, xyxy, input_l2d)
|
|
@@ -8939,7 +8948,7 @@ class xy_excel:
|
|
|
8939
8948
|
엑셀의 선택한 부분을 그대로 변경하는 것
|
|
8940
8949
|
|
|
8941
8950
|
"""
|
|
8942
|
-
sheet = self.check_sheet_name(
|
|
8951
|
+
sheet = self.check_sheet_name('')
|
|
8943
8952
|
xyxy = self.get_address_for_selection()
|
|
8944
8953
|
|
|
8945
8954
|
for x in range(xyxy[0], xyxy[2] + 1):
|
|
@@ -9159,7 +9168,7 @@ class xy_excel:
|
|
|
9159
9168
|
for aa in zz:
|
|
9160
9169
|
try:
|
|
9161
9170
|
pswd = "".join(aa)
|
|
9162
|
-
self.sheet_lock(
|
|
9171
|
+
self.sheet_lock('', pswd)
|
|
9163
9172
|
break
|
|
9164
9173
|
except:
|
|
9165
9174
|
pass
|
|
@@ -9194,10 +9203,10 @@ class xy_excel:
|
|
|
9194
9203
|
|
|
9195
9204
|
"""
|
|
9196
9205
|
sheet, [x1, y1, x2, y2], rng = self.check_sheet_n_xyxy(sheet_name, xyxy)
|
|
9197
|
-
l2d = self.read(
|
|
9206
|
+
l2d = self.read('', "")
|
|
9198
9207
|
result_l2d = self.rex.match_for_l2d_by_xysql(input_xre, l2d)
|
|
9199
9208
|
self.new_sheet()
|
|
9200
|
-
self.write_l2d_from_cell(
|
|
9209
|
+
self.write_l2d_from_cell('', [1, 1], result_l2d)
|
|
9201
9210
|
|
|
9202
9211
|
def select(self, sheet_name='', xyxy=''):
|
|
9203
9212
|
"""
|
|
@@ -9251,7 +9260,7 @@ class xy_excel:
|
|
|
9251
9260
|
현재의 셀 위치에서, offset으로 옮기는 것
|
|
9252
9261
|
|
|
9253
9262
|
"""
|
|
9254
|
-
sheet = self.check_sheet_name(
|
|
9263
|
+
sheet = self.check_sheet_name('')
|
|
9255
9264
|
x1, y1, x2, y2 = self.get_address_for_selection()
|
|
9256
9265
|
ox1, oy1, ox2, oy2 = self.change_address_to_xyxy(oxyxy)
|
|
9257
9266
|
rng = sheet.Range(sheet.Cells(x1 + ox1, y1 + oy1), sheet.Cells(x2 + ox2, y2 + oy2))
|
|
@@ -9883,7 +9892,7 @@ class xy_excel:
|
|
|
9883
9892
|
|
|
9884
9893
|
def set_scrollbar(self, sheet_name):
|
|
9885
9894
|
sheet = self.check_sheet_name(sheet_name)
|
|
9886
|
-
pxywh = self.change_address_to_pxywh(
|
|
9895
|
+
pxywh = self.change_address_to_pxywh('')
|
|
9887
9896
|
scrollbar_obj = sheet.Shapes.AddFormControl(Type=8, Left=pxywh[0], Top=pxywh[1], Width=pxywh[2], Height=pxywh[3])
|
|
9888
9897
|
scrollbar_obj.Name = "abc_1"
|
|
9889
9898
|
scrollbar_obj.ControlFormat.Value = 4
|
|
@@ -10132,7 +10141,7 @@ class xy_excel:
|
|
|
10132
10141
|
|
|
10133
10142
|
if not input_filename.endswith(".html"): input_filename = input_filename + ".html"
|
|
10134
10143
|
|
|
10135
|
-
json_code, title_list, input_filename = self.change_to_json_file(
|
|
10144
|
+
json_code, title_list, input_filename = self.change_to_json_file('', xyxy="", input_filename="D:\\temp\\abc.xlsx")
|
|
10136
10145
|
|
|
10137
10146
|
aaa = """
|
|
10138
10147
|
<!DOCTYPE html>
|
|
@@ -10304,21 +10313,21 @@ class xy_excel:
|
|
|
10304
10313
|
|
|
10305
10314
|
for index, one in enumerate(l2d_1):
|
|
10306
10315
|
current_x = current_x + 1
|
|
10307
|
-
self.write(
|
|
10316
|
+
self.write('', [current_x, 1], one)
|
|
10308
10317
|
temp = 0
|
|
10309
10318
|
for index2, one_2 in enumerate(l2d_2):
|
|
10310
10319
|
if one[0] == one_2[0] and (one[0] != "" or one[0] != None):
|
|
10311
10320
|
temp = temp + 1
|
|
10312
10321
|
if temp > 1:
|
|
10313
10322
|
current_x = current_x + 1
|
|
10314
|
-
self.write(
|
|
10323
|
+
self.write('', [current_x, len_width + 1], one_2)
|
|
10315
10324
|
l2d_3[index2] = ["", ""]
|
|
10316
10325
|
|
|
10317
10326
|
total_line_no = line + len(l2d_1)
|
|
10318
10327
|
for one in l2d_3:
|
|
10319
10328
|
if one[0] != "" and one[0] != None:
|
|
10320
10329
|
current_x = current_x + 1
|
|
10321
|
-
self.write(
|
|
10330
|
+
self.write('', [current_x, len_width + 1], one)
|
|
10322
10331
|
|
|
10323
10332
|
def split_address_to_str_n_num(self, xyxy=''):
|
|
10324
10333
|
"""
|
|
@@ -10379,7 +10388,7 @@ class xy_excel:
|
|
|
10379
10388
|
temp = ""
|
|
10380
10389
|
for iy, value in enumerate(l1d):
|
|
10381
10390
|
value = input_l2d[ix][iy]
|
|
10382
|
-
# value = self.read_at_cell(
|
|
10391
|
+
# value = self.read_at_cell('', [ix + 1, iy + 1])
|
|
10383
10392
|
if isinstance(value, str):
|
|
10384
10393
|
splited_value = value.split(split_char)
|
|
10385
10394
|
if isinstance(splited_value, list):
|
|
@@ -10435,8 +10444,8 @@ class xy_excel:
|
|
|
10435
10444
|
rng_select = self.get_address_for_usedrange('')
|
|
10436
10445
|
rng_used = self.get_address_for_usedrange('')
|
|
10437
10446
|
[x1, y1, x2, y2] = self.get_range_for_intersect_two_range(rng_select, rng_used)
|
|
10438
|
-
self.insert_yyline(
|
|
10439
|
-
self.insert_yyline(
|
|
10447
|
+
self.insert_yyline('', y1 + 1)
|
|
10448
|
+
self.insert_yyline('', y1 + 1)
|
|
10440
10449
|
result = []
|
|
10441
10450
|
length = 2
|
|
10442
10451
|
# 자료를 분리하여 리스트에 집어 넣는다
|
|
@@ -10449,7 +10458,7 @@ class xy_excel:
|
|
|
10449
10458
|
for x_no in range(len(result)):
|
|
10450
10459
|
if len(result[x_no]) > length:
|
|
10451
10460
|
for a in range(len(result[x_no]) - length):
|
|
10452
|
-
self.insert_yyline(
|
|
10461
|
+
self.insert_yyline('', y1 + length)
|
|
10453
10462
|
length = len(result[x_no])
|
|
10454
10463
|
for y_no in range(len(result[x_no])):
|
|
10455
10464
|
sheet.Cells(x1 + x_no, y1 + y_no + 1).Value = result[x_no][y_no]
|
|
@@ -10469,12 +10478,12 @@ class xy_excel:
|
|
|
10469
10478
|
"""
|
|
10470
10479
|
sheet = self.check_sheet_name(sheet_name)
|
|
10471
10480
|
for no in range(xyxy[2], xyxy[0], -1):
|
|
10472
|
-
value = self.read_at_cell(
|
|
10481
|
+
value = self.read_at_cell('', [no, xyxy[1]])
|
|
10473
10482
|
splited_value = value.split(splitted_char)
|
|
10474
10483
|
sheet.Cells(no, xyxy[1]).Value = splited_value[0].strip()
|
|
10475
10484
|
if len(splited_value) > 1:
|
|
10476
10485
|
for index, one in enumerate(splited_value[1:]):
|
|
10477
|
-
self.insert_xline(
|
|
10486
|
+
self.insert_xline('', no + index + 1)
|
|
10478
10487
|
sheet.Cells(no + index + 1, xyxy[1]).Value = one.strip()
|
|
10479
10488
|
|
|
10480
10489
|
def split_xline_as_per_input_word_for_yline(self, sheet_name, xyxy, yline_index=2, input_value="입력텍스트", first_line_is_title_tf=True):
|
|
@@ -10509,7 +10518,7 @@ class xy_excel:
|
|
|
10509
10518
|
새로운 시트에 써주는 것이다
|
|
10510
10519
|
발견한것을 기준으로 원래 값을 분리하는것
|
|
10511
10520
|
"""
|
|
10512
|
-
sheet = self.check_sheet_name(
|
|
10521
|
+
sheet = self.check_sheet_name('')
|
|
10513
10522
|
result = []
|
|
10514
10523
|
xyxy = self.get_address_for_selection()
|
|
10515
10524
|
for x in range(xyxy[0], xyxy[2] + 1):
|
|
@@ -10527,7 +10536,7 @@ class xy_excel:
|
|
|
10527
10536
|
atemp.insert(0, one_value)
|
|
10528
10537
|
result.append(atemp)
|
|
10529
10538
|
self.new_sheet()
|
|
10530
|
-
self.write_l2d_from_cell(
|
|
10539
|
+
self.write_l2d_from_cell('', [1, 1], result)
|
|
10531
10540
|
|
|
10532
10541
|
def unhide_all_sheet(self):
|
|
10533
10542
|
for sheet in self.xlbook.Sheets:
|
|
@@ -10624,12 +10633,12 @@ class xy_excel:
|
|
|
10624
10633
|
이것은 여러항목이 같은 값을 기준으로 원하는 것을 찾는 것이다
|
|
10625
10634
|
input_valuel = [자료의영역, 같은것이있는위치, 결과값의위치]
|
|
10626
10635
|
"""
|
|
10627
|
-
sheet = self.check_sheet_name(
|
|
10636
|
+
sheet = self.check_sheet_name('')
|
|
10628
10637
|
input_value1 = self.check_input_data(input_value1)
|
|
10629
10638
|
input_value2 = self.check_input_data(input_value2)
|
|
10630
10639
|
|
|
10631
|
-
base_data2d = self.read(
|
|
10632
|
-
compare_data2d = self.read(
|
|
10640
|
+
base_data2d = self.read('', input_value1[0])
|
|
10641
|
+
compare_data2d = self.read('', input_value2[0])
|
|
10633
10642
|
result = ""
|
|
10634
10643
|
for one_data_1 in base_data2d:
|
|
10635
10644
|
gijun = []
|
|
@@ -10652,10 +10661,10 @@ class xy_excel:
|
|
|
10652
10661
|
|
|
10653
10662
|
def vlookup_xyxy(self, sheet_name, find_xyxy, check_xyxy, find_value_option, find_value_oxy, write_oxy):
|
|
10654
10663
|
sheet = self.check_sheet_name(sheet_name)
|
|
10655
|
-
original_l2d = self.read(
|
|
10664
|
+
original_l2d = self.read('', find_xyxy)
|
|
10656
10665
|
dic_data = self.read_as_dic_with_xy_position(find_xyxy)
|
|
10657
10666
|
|
|
10658
|
-
l2d = self.read(
|
|
10667
|
+
l2d = self.read('', check_xyxy)
|
|
10659
10668
|
|
|
10660
10669
|
for ix, l1d in enumerate(l2d):
|
|
10661
10670
|
for iy, one_value in enumerate(l1d):
|
|
@@ -10734,8 +10743,8 @@ class xy_excel:
|
|
|
10734
10743
|
"""
|
|
10735
10744
|
활성화된 셀에 입력된 값을 쓰기
|
|
10736
10745
|
"""
|
|
10737
|
-
sheet = self.check_sheet_name(
|
|
10738
|
-
x1, y1, x2, y2 = self.change_address_to_xyxy(
|
|
10746
|
+
sheet = self.check_sheet_name('')
|
|
10747
|
+
x1, y1, x2, y2 = self.change_address_to_xyxy('')
|
|
10739
10748
|
sheet.Cells(x1, y1).Value = input_value
|
|
10740
10749
|
|
|
10741
10750
|
def write_at_cell(self, sheet_name='', xyxy='', input_value=None):
|
|
@@ -10806,7 +10815,7 @@ class xy_excel:
|
|
|
10806
10815
|
temp.append(l2d[x][y])
|
|
10807
10816
|
changed_l2d.append(temp)
|
|
10808
10817
|
self.new_sheet()
|
|
10809
|
-
self.write_l2d_from_cell(
|
|
10818
|
+
self.write_l2d_from_cell('', [1, 1], changed_l2d)
|
|
10810
10819
|
|
|
10811
10820
|
def write_by_value_priority(self, sheet_name='', xyxy='', input_l2d=None):
|
|
10812
10821
|
"""
|
|
@@ -10999,7 +11008,7 @@ class xy_excel:
|
|
|
10999
11008
|
1차원자료를 n개씩 세로로 써주는 것
|
|
11000
11009
|
"""
|
|
11001
11010
|
input_l1d = self.check_input_data(input_l1d)
|
|
11002
|
-
sheet = self.check_sheet_name(
|
|
11011
|
+
sheet = self.check_sheet_name('')
|
|
11003
11012
|
mok, namuji = divmod(len(input_l1d), step_no)
|
|
11004
11013
|
if namuji > 0:
|
|
11005
11014
|
mok = mok + 1
|
|
@@ -11242,7 +11251,7 @@ class xy_excel:
|
|
|
11242
11251
|
"""
|
|
11243
11252
|
sheet, [x1, y1, x2, y2], rng = self.check_sheet_n_xyxy('', xyxy)
|
|
11244
11253
|
|
|
11245
|
-
all_data = self.read(
|
|
11254
|
+
all_data = self.read('', xyxy) # 1
|
|
11246
11255
|
x1, y1, x2, y2 = self.change_address_to_xyxy(xyxy)
|
|
11247
11256
|
for index, l1d in enumerate(all_data):
|
|
11248
11257
|
current_x = x1 + index
|
|
@@ -11251,7 +11260,7 @@ class xy_excel:
|
|
|
11251
11260
|
found = self.rex.search_all_by_xysql(input_xre, value) # 정규표현식에 맞는 값을 확인
|
|
11252
11261
|
# [[결과값, 시작순서, 끝순서, [그룹1, 그룹2...], match결과].....]
|
|
11253
11262
|
if found: # 만약 발견하면
|
|
11254
|
-
gijon = self.read_at_cell(
|
|
11263
|
+
gijon = self.read_at_cell('', [current_x, result_line_no])
|
|
11255
11264
|
changed_gijon = gijon + "," + l1d[0] + ":" + str(l1d[1]) + ":" + str(l1d[2])
|
|
11256
11265
|
if not changed_value_line_no:
|
|
11257
11266
|
sheet.Cells(current_x, result_line_no).Value = current_x, result_line_no
|
|
@@ -11333,7 +11342,7 @@ class xy_excel:
|
|
|
11333
11342
|
"""
|
|
11334
11343
|
선택한 영역에 시작번호, 간격으로 이루어진 연속된 숫자를 쓰는것 (예 : 0,2,4,6,8....)
|
|
11335
11344
|
"""
|
|
11336
|
-
sheet = self.check_sheet_name(
|
|
11345
|
+
sheet = self.check_sheet_name('')
|
|
11337
11346
|
new_no = start_no
|
|
11338
11347
|
for no in range(0, xyxy[2] - xyxy[0] + 1):
|
|
11339
11348
|
sheet.Cells(xyxy[0], xyxy[1] + no).Value = new_no
|
|
@@ -11385,32 +11394,32 @@ class xy_excel:
|
|
|
11385
11394
|
if data_type == "l1d":
|
|
11386
11395
|
data = self.varx["data"][input_value]
|
|
11387
11396
|
self.new_sheet()
|
|
11388
|
-
self.write(
|
|
11397
|
+
self.write('', [1, 1], data, True)
|
|
11389
11398
|
elif data_type == "l2d":
|
|
11390
11399
|
data = self.varx["data"][input_value]
|
|
11391
11400
|
self.new_sheet()
|
|
11392
|
-
self.write(
|
|
11401
|
+
self.write('', [1, 1], data, True)
|
|
11393
11402
|
elif data_type == "t2d":
|
|
11394
11403
|
data = self.varx["data"][input_value]
|
|
11395
11404
|
changed_data = data.splitlines()
|
|
11396
11405
|
self.new_sheet()
|
|
11397
|
-
self.write(
|
|
11406
|
+
self.write('', [1, 1], changed_data, True)
|
|
11398
11407
|
elif data_type == "table2d":
|
|
11399
11408
|
data = self.varx["data"][input_value]
|
|
11400
11409
|
self.new_sheet()
|
|
11401
|
-
self.write(
|
|
11410
|
+
self.write('', [1, 1], data, True)
|
|
11402
11411
|
elif data_type == "d1d":
|
|
11403
11412
|
data = self.varx["data"][input_value]
|
|
11404
11413
|
self.new_sheet()
|
|
11405
11414
|
for index, key in enumerate(data.keys()):
|
|
11406
|
-
self.write(
|
|
11407
|
-
self.write(
|
|
11415
|
+
self.write('', [1 + index, 1], key, True)
|
|
11416
|
+
self.write('', [1 + index, 2], str(data[key]), True)
|
|
11408
11417
|
elif data_type == "d2d":
|
|
11409
11418
|
data = self.varx["data"][input_value]
|
|
11410
11419
|
self.new_sheet()
|
|
11411
11420
|
for index, key in enumerate(data.keys()):
|
|
11412
|
-
self.write(
|
|
11413
|
-
self.write(
|
|
11421
|
+
self.write('', [1 + index, 1], key, True)
|
|
11422
|
+
self.write('', [1 + index, 2], str(data[key]), True)
|
|
11414
11423
|
|
|
11415
11424
|
def write_title_from_first_line(self, sheet_name='', xyxy=''):
|
|
11416
11425
|
"""
|
|
@@ -11485,7 +11494,7 @@ class xy_excel:
|
|
|
11485
11494
|
x1, y1 = [1, 1]
|
|
11486
11495
|
if start_xy:
|
|
11487
11496
|
x1, y1, x2, y2 = self.change_address_to_xyxy(start_xy)
|
|
11488
|
-
self.write(
|
|
11497
|
+
self.write('', [x1, y1], input_value)
|
|
11489
11498
|
|
|
11490
11499
|
def is_sheet_empty(self, sheet_obj):
|
|
11491
11500
|
"""시트가 비어있는지 확인"""
|
|
@@ -11531,14 +11540,13 @@ class xy_excel:
|
|
|
11531
11540
|
merged_wb.SaveAs(os.path.abspath(output_path))
|
|
11532
11541
|
merged_wb.Close()
|
|
11533
11542
|
|
|
11534
|
-
|
|
11535
11543
|
def all_data_for_quote_no(self, gijun_no):
|
|
11536
11544
|
# 엑셀의 관리시트에서 관리 번호를 입력하면 그에대한 정보를 갖고오는것
|
|
11537
11545
|
data_start_x= 2
|
|
11538
|
-
xy = self.get_address_for_bottom_end(
|
|
11546
|
+
xy = self.get_address_for_bottom_end('', [3,5])
|
|
11539
11547
|
if xy[0]-50 < data_start_x:
|
|
11540
11548
|
xy[0] =50+ data_start_x
|
|
11541
|
-
l2d_15 = self.read_range(
|
|
11549
|
+
l2d_15 = self.read_range('', [xy[0]-50, 1, xy[0], 40])
|
|
11542
11550
|
|
|
11543
11551
|
#맨앞부분에 엑셀의 가로본호를 넣는다 (엑셀의 위치를 알고싶어서)
|
|
11544
11552
|
for index, item in enumerate(l2d_15):
|
|
@@ -2314,3 +2314,57 @@ class xy_outlook:
|
|
|
2314
2314
|
else:
|
|
2315
2315
|
result = input_value
|
|
2316
2316
|
return result
|
|
2317
|
+
|
|
2318
|
+
def new_signed_mail_at_draft_folder(self, to='', subject='', body='', Cc='',attachments=''):
|
|
2319
|
+
#임시보관함에 새 메일을 만드는 것
|
|
2320
|
+
|
|
2321
|
+
folder = self.outlook.GetDefaultFolder(16)
|
|
2322
|
+
new_mail = self.outlook_program.Createltem(0)
|
|
2323
|
+
new_mail.Display()
|
|
2324
|
+
#current body = mail.HTMLBody
|
|
2325
|
+
if to: new_mail.To = to
|
|
2326
|
+
if subject: new_mail.Subject = subject
|
|
2327
|
+
if body:
|
|
2328
|
+
new_mail.HTMLBody = new_mail.HTMLBody.replace(
|
|
2329
|
+
"<body",
|
|
2330
|
+
f"<body"
|
|
2331
|
+
).replace(
|
|
2332
|
+
">",
|
|
2333
|
+
f"> {body}",
|
|
2334
|
+
1 #첫 번째> 만 교체 (body 태그의 닫는 >)
|
|
2335
|
+
)
|
|
2336
|
+
|
|
2337
|
+
if cc: new_mail.CC = cc
|
|
2338
|
+
if attachments:
|
|
2339
|
+
for num in range(len(attachments)):
|
|
2340
|
+
new_mail.Attachments.Add(attachments[num])
|
|
2341
|
+
new_mail.Move(folder)
|
|
2342
|
+
|
|
2343
|
+
def save_email_as_pdf_exact_2(self, save_path, file_name):
|
|
2344
|
+
word_app = None
|
|
2345
|
+
temp_mhtml = None
|
|
2346
|
+
try:
|
|
2347
|
+
inspector = self.outlook_program.ActiveInspector()
|
|
2348
|
+
if inspector:
|
|
2349
|
+
mail = inspector.CurrentItem
|
|
2350
|
+
else:
|
|
2351
|
+
explorer = self.outlook_program.ActiveExplorer()
|
|
2352
|
+
mail = explorer.Selection.Item(1)
|
|
2353
|
+
if not file_name.lower0.endswith('.pdf'):
|
|
2354
|
+
file_name += '.pdf'
|
|
2355
|
+
full_pdf_path = os.path.abspath(os.path.join(save_path, file_name))
|
|
2356
|
+
temp_mhtml= os.path.abspath(os.path.join(save_path, "temp_mail_format.mhtml"))
|
|
2357
|
+
mail.SaveAs(temp_mhtml, 10)
|
|
2358
|
+
word_app = win32com.client.Dispatch("Word.Application")
|
|
2359
|
+
word_app.Visible=False
|
|
2360
|
+
doc = word_app.Documents.Open(temp_mhtml)
|
|
2361
|
+
doc.ExportAsFixedFormat(OutputFileName=full_pdf_path, ExportFormat=17)
|
|
2362
|
+
doc.Close(False)
|
|
2363
|
+
return True
|
|
2364
|
+
except Exception as e:
|
|
2365
|
+
return False
|
|
2366
|
+
finally:
|
|
2367
|
+
if word_app:
|
|
2368
|
+
word_app.Quit()
|
|
2369
|
+
if temp_mhtml and os.path.exists(temp_mhtml):
|
|
2370
|
+
os.remove(temp_mhtml)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|