mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
rrs: Minor changes to work with Python3
[YOCTO #9746] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
This commit is contained in:
parent
bdf276a0fb
commit
d170279f18
|
@ -5,13 +5,15 @@
|
||||||
#
|
#
|
||||||
# Licensed under the MIT license, see COPYING.MIT for details
|
# Licensed under the MIT license, see COPYING.MIT for details
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
def common_setup():
|
def common_setup():
|
||||||
import sys, os
|
import sys, os
|
||||||
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '../../')))
|
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '../../')))
|
||||||
|
|
||||||
def get_logger(name, settings):
|
def get_logger(name, settings):
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
|
from logging.handlers import RotatingFileHandler
|
||||||
|
|
||||||
logger = logging.getLogger(name)
|
logger = logging.getLogger(name)
|
||||||
formatter = logging.Formatter("%(asctime)s: %(levelname)s: %(message)s")
|
formatter = logging.Formatter("%(asctime)s: %(levelname)s: %(message)s")
|
||||||
|
@ -22,8 +24,8 @@ def get_logger(name, settings):
|
||||||
|
|
||||||
filename = os.path.join(settings.TOOLS_LOG_DIR, name)
|
filename = os.path.join(settings.TOOLS_LOG_DIR, name)
|
||||||
maxBytes = 8388608 # 8MB
|
maxBytes = 8388608 # 8MB
|
||||||
handler = logging.handlers.RotatingFileHandler(filename,
|
handler = RotatingFileHandler(filename, maxBytes=maxBytes)
|
||||||
maxBytes=maxBytes)
|
|
||||||
handler.setFormatter(formatter)
|
handler.setFormatter(formatter)
|
||||||
logger.addHandler(handler)
|
logger.addHandler(handler)
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ if __name__=="__main__":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
distro_info = search_package_in_distros(pkglst_dir, recipe, recipe_data)
|
distro_info = search_package_in_distros(pkglst_dir, recipe, recipe_data)
|
||||||
for distro, alias in distro_info.iteritems():
|
for distro, alias in distro_info.items():
|
||||||
recipedistro = RecipeDistro()
|
recipedistro = RecipeDistro()
|
||||||
recipedistro.recipe = recipe
|
recipedistro.recipe = recipe
|
||||||
recipedistro.distro = distro
|
recipedistro.distro = distro
|
||||||
|
|
|
@ -22,7 +22,7 @@ from common import common_setup, update_repo, get_pv_type, load_recipes, \
|
||||||
get_logger
|
get_logger
|
||||||
common_setup()
|
common_setup()
|
||||||
from layerindex import utils, recipeparse
|
from layerindex import utils, recipeparse
|
||||||
from layerindex.update import split_recipe_fn
|
from layerindex.update_layer import split_recipe_fn
|
||||||
|
|
||||||
utils.setup_django()
|
utils.setup_django()
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
|
|
Loading…
Reference in New Issue
Block a user