change to python3 instead of explicit 3.6
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import configparser
|
||||
import copy
|
||||
import datetime
|
||||
import importlib
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
@@ -16,6 +17,20 @@ cfgfile = os.path.join(os.environ['HOME'],
|
||||
'repoclone',
|
||||
'centos.ini')
|
||||
|
||||
# Set up the logger.
|
||||
_selfpath = os.path.abspath(os.path.expanduser(__file__))
|
||||
_logmodpath = os.path.join(_selfpath,
|
||||
'..', '..', '..',
|
||||
'lib',
|
||||
'python',
|
||||
'logger.py')
|
||||
logger = importlib.util.module_from_spec(
|
||||
importlib.util.spec_from_file_location(
|
||||
'logger',
|
||||
_logmodpath))
|
||||
_loglevel = 'warning'
|
||||
#_loglevel = 'debug'
|
||||
|
||||
class cur_ver(object):
|
||||
def __init__(self):
|
||||
_distname = platform.linux_distribution()[0]
|
||||
@@ -90,6 +105,10 @@ class MirrorMgr(object):
|
||||
self.get_cfg()
|
||||
self.chk_cur_ver()
|
||||
self.parse_cfg()
|
||||
self.log = logger.log(os.path.abspath(os.path.expanduser(
|
||||
logfile = self.cfg['DEFAULT'])),
|
||||
logname = 'optools.repoclone.centos',
|
||||
loglvl = _loglevel)
|
||||
|
||||
def get_cfg(self):
|
||||
with open(cfgfile, 'r') as f:
|
||||
|
||||
Reference in New Issue
Block a user