mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
rrs/tools/common.py: import sys/os at top
These are common enough that they should be imported up front. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
aad000734c
commit
33e3dee9e7
|
@ -5,6 +5,8 @@
|
||||||
#
|
#
|
||||||
# Licensed under the MIT license, see COPYING.MIT for details
|
# Licensed under the MIT license, see COPYING.MIT for details
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
class DryRunRollbackException(Exception):
|
class DryRunRollbackException(Exception):
|
||||||
|
@ -12,12 +14,10 @@ class DryRunRollbackException(Exception):
|
||||||
|
|
||||||
|
|
||||||
def common_setup():
|
def common_setup():
|
||||||
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__), '../../')))
|
||||||
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '../../layerindex')))
|
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '../../layerindex')))
|
||||||
|
|
||||||
def get_logger(name, settings):
|
def get_logger(name, settings):
|
||||||
import os
|
|
||||||
from logging.handlers import RotatingFileHandler
|
from logging.handlers import RotatingFileHandler
|
||||||
|
|
||||||
logger = logging.getLogger(name)
|
logger = logging.getLogger(name)
|
||||||
|
@ -39,7 +39,6 @@ def get_logger(name, settings):
|
||||||
return logger
|
return logger
|
||||||
|
|
||||||
def update_repo(fetchdir, repo_name, repo_url, pull, logger):
|
def update_repo(fetchdir, repo_name, repo_url, pull, logger):
|
||||||
import os
|
|
||||||
from layerindex import utils, recipeparse
|
from layerindex import utils, recipeparse
|
||||||
|
|
||||||
path = os.path.join(fetchdir, repo_name)
|
path = os.path.join(fetchdir, repo_name)
|
||||||
|
@ -69,7 +68,6 @@ def get_pv_type(pv):
|
||||||
|
|
||||||
def get_recipe_files(layerdir):
|
def get_recipe_files(layerdir):
|
||||||
from layerindex import recipeparse
|
from layerindex import recipeparse
|
||||||
import os
|
|
||||||
|
|
||||||
sublayer_dirs = []
|
sublayer_dirs = []
|
||||||
for root, dirs, files in os.walk(layerdir):
|
for root, dirs, files in os.walk(layerdir):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user