
NOTICE: All information contained herein is, and remains
the property of TechnoCore.
The intellectual and technical concepts contained
herein are proprietary to TechnoCore and dissemination of this information or reproduction of this material
is strictly forbidden unless prior written permission is obtained
from TechnoCore.
The ObjImportApi class in ObjDataImportLog.py is a specialized tool for importing and parsing log files. It is designed to handle specific log formats, such as Apache error logs, by extending the ObjData.ObjData class.
[]).datetime objects.__init__(self, DB=0)Initializes the ObjImportApi object, inheriting from ObjData.ObjData.
DetectSeparator(self, Filename)Identifies the separator used in the log file. For the current implementation, it assumes that log entries are separated by brackets ([]) and returns [ as the primary separator.
PrepFile(self, Filename)Prepares the log file for import. This method returns the filename without any modifications.
OpenFile(self, Filename)Opens the specified log file for reading. It determines the delimiter and prepares the file for line-by-line processing.
CloseFile(self)Closes the log file that is currently open.
ColumnList(self)Returns a list of column names based on the log file type, which is specified by self._Sheetname. For example, for an apache_error log, it returns ["event_date", "event_type", "pid", "event_note"].
NextRow(self)Reads the next line from the log file and parses it into a structured row. It splits the line by the detected separator, cleans up the segments, and converts the timestamp into a datetime object. If the end of the file is reached, it returns 'EOF'.
# Create an instance of the importer
log_importer = ObjImportApi()
# Specify the log type
log_importer._Sheetname = "apache_error"
# Open a log file
log_importer.OpenFile("error.log")
# Get the column list
columns = log_importer.ColumnList()
print("Columns:", columns)
# Process rows
while True:
row = log_importer.NextRow()
if row == 'EOF':
break
print("Log entry:", row)
# Close the file
log_importer.CloseFile()
A quantitative measure of the number of linearly independent
paths through a program's source code.
M 62:4 ObjImportApi.NextRow - B
M 52:4 ObjImportApi.ColumnList - A
C 28:0 ObjImportApi - A
M 40:4 ObjImportApi.OpenFile - A
M 30:4 ObjImportApi.__init__ - A
M 33:4 ObjImportApi.DetectSeparator - A
M 37:4 ObjImportApi.PrepFile - A
M 49:4 ObjImportApi.CloseFile - A
Halstead’s goal was to identify measurable properties of software, and the
relations between them. These numbers are statically computed from the source code
η1 = the number of distinct operators
η2 = the number of distinct operands
N1 = the total number of operators
N2 = the total number of operands
h1: 3
h2: 12
N1: 7
N2: 12
vocabulary: 15
length: 19
calculated_length: 47.77443751081735
volume: 74.23092131656186
difficulty: 1.5
effort: 111.34638197484279
time: 6.185910109713488
bugs: 0.024743640438853954
Maintainability Index is a software metric which measures how maintainable
factory.import/ObjDataImportLog.py - A
Updated : 2025-11-26