mirror of
https://github.com/Astatin3/dsevent-parser.git
synced 2026-06-09 00:28:03 -06:00
Code stuff
This commit is contained in:
Generated
+8
@@ -0,0 +1,8 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
Generated
+8
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="PYTHON_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="PyPep8Inspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||||
|
</profile>
|
||||||
|
</component>
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<settings>
|
||||||
|
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||||
|
<version value="1.0" />
|
||||||
|
</settings>
|
||||||
|
</component>
|
||||||
Generated
+7
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Black">
|
||||||
|
<option name="sdkName" value="Python 3.11" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11" project-jdk-type="Python SDK" />
|
||||||
|
</project>
|
||||||
Generated
+8
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/dsevent-parser.iml" filepath="$PROJECT_DIR$/.idea/dsevent-parser.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+6
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
,astatin3,acer,09.07.2024 11:21,file:///home/astatin3/.config/libreoffice/4;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
,astatin3,acer,09.07.2024 12:08,file:///home/astatin3/.config/libreoffice/4;
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
import sys
|
||||||
|
import re
|
||||||
|
|
||||||
|
def split_with_xml_tags(text):
|
||||||
|
pattern = r'(<[^/][^>]*>)|([^<]+)'
|
||||||
|
matches = re.findall(pattern, text)
|
||||||
|
return [match[0] if match[0] else match[1] for match in matches]
|
||||||
|
|
||||||
|
array = []
|
||||||
|
|
||||||
|
with open(sys.argv[1], 'r') as f:
|
||||||
|
data = f.read()
|
||||||
|
log_data = split_with_xml_tags(data)
|
||||||
|
|
||||||
|
data = [None, None, None]
|
||||||
|
type_id = -1
|
||||||
|
for i, log in enumerate(log_data):
|
||||||
|
match log:
|
||||||
|
case "<TagVersion>":
|
||||||
|
type_id = 0
|
||||||
|
continue
|
||||||
|
case "<time>":
|
||||||
|
type_id = 1
|
||||||
|
continue
|
||||||
|
case "<message>":
|
||||||
|
type_id = 2
|
||||||
|
continue
|
||||||
|
|
||||||
|
if type_id == 0:
|
||||||
|
array.append(data)
|
||||||
|
data = [None, None, None]
|
||||||
|
|
||||||
|
data[type_id] = log
|
||||||
|
|
||||||
|
|
||||||
|
for line in array:
|
||||||
|
|
||||||
|
if None in line:
|
||||||
|
continue
|
||||||
|
|
||||||
|
if not "Drive" in line[2]:
|
||||||
|
continue
|
||||||
|
|
||||||
|
if not sys.argv[2] in line[2].split(",")[0]:
|
||||||
|
continue
|
||||||
|
if not sys.argv[3] in line[2].split(",")[0]:
|
||||||
|
continue
|
||||||
|
|
||||||
|
for i, col in enumerate(line):
|
||||||
|
match i:
|
||||||
|
case 0:
|
||||||
|
print(col.split(" ")[0], end=',')
|
||||||
|
continue
|
||||||
|
case 1:
|
||||||
|
print(col.split(" ")[1], end=',')
|
||||||
|
continue
|
||||||
|
case 2:
|
||||||
|
print(col.split(" ")[4], end=',')
|
||||||
|
continue
|
||||||
|
|
||||||
|
print("\n", end='')
|
||||||
+9206
File diff suppressed because it is too large
Load Diff
+9205
File diff suppressed because it is too large
Load Diff
+9206
File diff suppressed because it is too large
Load Diff
+9206
File diff suppressed because it is too large
Load Diff
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Reference in New Issue
Block a user