From 2f1a0028ff2912b9897d4d83639425ffc0de1798 Mon Sep 17 00:00:00 2001 From: cuixucui <350255958@qq.com> Date: Thu, 25 Jun 2020 08:09:46 +0800 Subject: [PATCH] Code specification rectification --- hwcompatible/compatibility.py | 2 +- hwcompatible/document.py | 21 ++++++++++++++++++--- hwcompatible/sysinfo.py | 5 ++++- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/hwcompatible/compatibility.py b/hwcompatible/compatibility.py index 9ddd270..01e9155 100755 --- a/hwcompatible/compatibility.py +++ b/hwcompatible/compatibility.py @@ -442,7 +442,7 @@ class EulerCertification(object): def update_factory(self, test_factory): """ - update teset factory + update tese factory :param test_factory: :return: """ diff --git a/hwcompatible/document.py b/hwcompatible/document.py index 5584ec3..8d86f88 100755 --- a/hwcompatible/document.py +++ b/hwcompatible/document.py @@ -21,7 +21,10 @@ from .sysinfo import SysInfo from .env import CertEnv -class Document: +class Document(object): + """ + Read and write documents + """ def __init__(self, filename, document=''): self.document = document self.filename = filename @@ -51,6 +54,9 @@ class Document: class CertDocument(Document): + """ + get hardware and release information + """ def __init__(self, filename, document=''): super(CertDocument, self).__init__(filename, document) self.document = dict() @@ -107,6 +113,9 @@ class CertDocument(Document): class DeviceDocument(Document): + """ + get device document + """ def __init__(self, filename, devices=''): super(DeviceDocument, self).__init__(filename, devices) self.filename = filename @@ -119,6 +128,10 @@ class DeviceDocument(Document): class FactoryDocument(Document): + """ + get factory from file or factory parameter + """ + def __init__(self, filename, factory=''): super(FactoryDocument, self).__init__(filename, factory) self.document = list() @@ -147,9 +160,11 @@ class FactoryDocument(Document): return factory -class ConfigFile: +class ConfigFile(object): + """ + Get parameters from configuration file + """ def __init__(self, filename): - super(ConfigFile, self).__init__(filename) self.filename = filename self.parameters = dict() self.config = list() diff --git a/hwcompatible/sysinfo.py b/hwcompatible/sysinfo.py index d5c5dcd..e7bae13 100755 --- a/hwcompatible/sysinfo.py +++ b/hwcompatible/sysinfo.py @@ -16,7 +16,10 @@ import os import re -class SysInfo: +class SysInfo(object): + """ + Get system information + """ def __init__(self, filename): self.product = None self.version = None -- GitLab