Configuration file operation processing method and device

A configuration file and file processing technology, which is applied in the direction of program control device, software maintenance/management, version control, etc., can solve the problems of configuration file equal sign invalidation, affecting software function, configuration file format confusion, etc., to avoid impact and improve reliability effect

Inactive Publication Date: 2017-01-11
INSPUR BEIJING ELECTRONICS INFORMATION IND
View PDF2 Cites 6 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] However, in the process of encapsulating the command line, when using Python's ConfigParser module to process the configuration file, when the configuration file is written back after the operation is completed, the colon ":" that appears in the name in the original parameters in the configuration file will change to In this way, the format of the configuration file will be confused, and the equal sign in the original parameters of the configuration file will become invalid, resulting in the unavailability of specific configuration items in the configuration file and affecting the software function.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Configuration file operation processing method and device
  • Configuration file operation processing method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0026] The core of the present invention is to provide a configuration file operation processing method and its device, which can avoid the problem that the colon ":" in the name in parameters becomes an equal sign "=" after the configuration file is written back, thereby avoiding the configuration file. The situation where the configuration file specific configuration items are unavailable due to confusion in the format improves the reliability of configuration file processing.

[0027] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiment...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a configuration file operation processing method which is used for a ConfigParser module of Python and comprises: receiving a configuration file to be processed, calling a first format replacement function to carry out a first format replacement operation on the configuration file, and replacing a colon in name in parameters in the configuration file with a specific character; carrying out a corresponding file processing operation on the configuration file subjected to first format replacement, and after completing the operation, writing the configuration file back into a system to carry out saving processing; calling a second format replacement function to carry out a second format replacement operation on the saved configuration file, and replacing the specific character in the name in the parameters in the configuration file with a colon. According to the configuration file operation processing method disclosed by the invention, a case of generating the problem that after the configuration file is written back, the colon : in the name in the parameters is changed into an equal sign = is avoided, so that a case of unavailability of a specific configuration item of the configuration file, which is caused by chaos of a format of the configuration file, is avoided. The invention further discloses a configuration file operation processing device. The configuration file operation processing device also has the advantages above, which are not repeated herein.

Description

technical field [0001] The invention relates to the field of configuration files, in particular to a configuration file operation processing method and device thereof. Background technique [0002] If the program does not have any configuration files, then the program is completely closed. Once the program needs to modify some parameters, the program code itself must be modified and recompiled. Use the configuration file to flexibly configure some parameters. The configuration parameters involve the analysis of the configuration file. The analysis of the configuration file is not complicated. The ConfigParser module in Python is used for reading, writing and parsing of the configuration file. [0003] The format of the INI type configuration file includes three basic elements parameters, sections and comments. Among them, the most basic element is parameters, and parameters are composed of name and value, and name and value are separated by an equal sign. All parameters ar...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/44
CPCG06F8/71
Inventor 刘二明
Owner INSPUR BEIJING ELECTRONICS INFORMATION IND
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products