You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
1005 B
25 lines
1005 B
|
7 days ago
|
# -*- coding: utf-8 -*-
|
||
|
|
import io, sys
|
||
|
|
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
||
|
|
|
||
|
|
F = r'e:\code\crm-backend-matt\crm-opportunity\src\main\java\com\crm\opportunity\controller\OpportunitySubController.java'
|
||
|
|
txt = open(F, encoding='utf-8', newline='').read()
|
||
|
|
lines = txt.split('\r\n')
|
||
|
|
print("total lines:", len(lines))
|
||
|
|
# Set import 是否在
|
||
|
|
print("has Set import:", "import java.util.Set;" in txt)
|
||
|
|
print("has ATTACHMENT_BIZ_TYPES:", "ATTACHMENT_BIZ_TYPES" in txt)
|
||
|
|
print("has required=false bizType in add:", 'value = "bizType", required = false' in txt)
|
||
|
|
# class 头区域
|
||
|
|
for i, ln in enumerate(lines, 1):
|
||
|
|
if 'public class OpportunitySubController' in ln:
|
||
|
|
for j in range(i-1, min(i+6, len(lines))):
|
||
|
|
print(f"{j+1:3d} {repr(lines[j])}")
|
||
|
|
break
|
||
|
|
# addAttachment 区域
|
||
|
|
for i, ln in enumerate(lines, 1):
|
||
|
|
if 'addAttachment' in ln:
|
||
|
|
for j in range(max(0, i-9), min(i+13, len(lines))):
|
||
|
|
print(f"{j+1:3d} {repr(lines[j])}")
|
||
|
|
break
|