修改coding代码扫描警告

This commit is contained in:
qihao.gong@jikimo.com
2023-11-27 17:08:11 +08:00
parent 964618d365
commit c78ea6fbe5
15 changed files with 24 additions and 42 deletions

View File

@@ -3,9 +3,7 @@ import os
import time
import json
import base64
import shutil
import logging
import hashlib
from io import BytesIO
from zipfile import ZipFile
from datetime import datetime, timedelta
@@ -13,8 +11,6 @@ import requests
from odoo.http import request
from odoo import fields, models, api, _
from odoo.exceptions import UserError
from odoo.exceptions import MissingError
from odoo.exceptions import ValidationError
from odoo.addons.sf_machine_connect.models import py2opcua, ftp_operate
_logger = logging.getLogger(__name__)

View File

@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
import os
import logging
from ftplib import FTP
@@ -20,7 +19,6 @@ class FTP_P(FTP):
cmd = 'LIST'
templist = []
tempdic = {}
func = None
if args[-1:] and type(args[-1]) != type(''):
args, func = args[:-1], args[-1]
for arg in args:

View File

@@ -1,6 +1,6 @@
# -*-coding:utf-8-*-
from odoo import api, fields, models, SUPERUSER_ID, _
from odoo.exceptions import UserError
from odoo import api, fields, models
class SfEquipmentSaintenanceStandards(models.Model):

View File

@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
import json
import base64
from datetime import date, datetime, timedelta
from datetime import timedelta
import requests
from odoo.addons.sf_base.commons.common import Common
from odoo import api, fields, models, SUPERUSER_ID, _
from odoo import api, fields, models, _
from odoo.exceptions import UserError

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import base64
from odoo import api, fields, models, SUPERUSER_ID, _
from odoo import api, fields, models, _
from odoo.exceptions import UserError

View File

@@ -41,14 +41,6 @@
],
'qweb': [
],
'assets': {
'web.assets_backend': [
'sf_manufacturing/static/src/js/kanban_change.js',
'sf_manufacturing/static/src/scss/kanban_change.scss',
'sf_manufacturing/static/src/xml/kanban_change.xml',
],
},
'license': 'LGPL-3',
'installable': True,
'application': False,

View File

@@ -616,7 +616,7 @@ class CNCprocessing(models.Model):
logging.info('folder_name:%s' % folder_name)
serverdir = os.path.join('/tmp', folder_name, 'return', processing_panel)
logging.info('serverdir:%s' % serverdir)
for root, dirs, files in os.walk(serverdir):
for root, files in os.walk(serverdir):
for f in files:
logging.info('f:%s' % f)
if os.path.splitext(f)[1] == ".pdf":

View File

@@ -2,7 +2,7 @@
import logging
from odoo.modules import get_resource_path
from odoo import fields, models, api
# from quatotion import readSql, feature_recognize, auto_quatotion
from quatotion import readSql, feature_recognize, auto_quatotion
__author__ = 'jinling.yang'
_logger = logging.getLogger(__name__)
@@ -24,14 +24,14 @@ class AutoQuatotion(models.Model):
def get_process_time_db_path(self):
return get_resource_path('sf_sale', 'models', 'process_time.db')
# def get_auto_quatotion(self, stp_url, feature_full_path, process_time_db_path, model_code):
# '''
# 通过打包好的.so库
# 以调用autoQuatotion库中Quatotion类
# 初始化后调用类的analyseShape方法对模型文件进行价格预测
# '''
# # 初始化自动报价类(输入特征数据库和加工时间数据库)
# reader = auto_quatotion.Quatotion(feature_full_path, process_time_db_path)
# # 获取价格、加工时间、尺寸、XYZ、翻面次数
# feature_info = reader.analyseShape(stp_url, InfoJson={})
# return feature_info
def get_auto_quatotion(self, stp_url, feature_full_path, process_time_db_path, model_code):
'''
通过打包好的.so库
以调用autoQuatotion库中Quatotion类
初始化后调用类的analyseShape方法对模型文件进行价格预测
'''
# 初始化自动报价类(输入特征数据库和加工时间数据库)
reader = auto_quatotion.Quatotion(feature_full_path, process_time_db_path)
# 获取价格、加工时间、尺寸、XYZ、翻面次数
feature_info = reader.analyseShape(stp_url, InfoJson={})
return feature_info

View File

@@ -12,7 +12,7 @@
'website': 'https://www.sf.jikimo.com',
'depends': ['sf_base', 'sf_manufacturing'],
'data': [
# 'security/group_security.xml',
'security/group_security.xml',
'security/ir.model.access.csv',
# 'views/tool_base_views.xml',
# # 'views/menu_view.xml',

View File

@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
import logging
from odoo import SUPERUSER_ID, _, api, fields, models
from odoo import api, fields, models
from odoo.osv import expression

View File

@@ -23,7 +23,6 @@ try:
import httpagentparser
except ImportError:
pass
from time import gmtime, strftime
from odoo.addons.web.controllers import home
from odoo.http import request
from odoo.exceptions import Warning

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from odoo import models, fields, api, _
from odoo import models, fields
class LoginImage(models.Model):

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models, modules
from odoo import api, fields, models
class ResConfigSettings(models.TransientModel):

View File

@@ -8,11 +8,9 @@ import werkzeug.exceptions
import werkzeug.utils
import werkzeug.wrappers
import werkzeug.wsgi
from werkzeug.urls import url_parse
from odoo import http
from odoo.http import content_disposition, request
from odoo.tools.safe_eval import safe_eval, time
from odoo.http import request
from odoo.addons.web.controllers.report import ReportController
from ..models.common import Common

View File

@@ -18,4 +18,4 @@ class Common(models.Model):
tsclibrary.printlabelW("0", "1");
tsclibrary.closeport();
except Exception as e:
raise UserWarning("错误警告")
raise UserWarning("错误警告:%s" % e)