Few fixes

This commit is contained in:
Marc Garcia Puig 2019-07-09 14:15:51 +02:00 committed by Néstor Subirón
parent 070aae5a9c
commit 7ba7587c78
3 changed files with 5 additions and 20 deletions

View File

@ -109,7 +109,7 @@ Import
│ │ ├── LaneMarking1_Spec.png
│ │ ├── MapToImport01.fbx
│ │ └── MapToImport01.xodr
| ── MapToImport02
| ── MapToImport02
│ │ ├── MapToImport02.fbx
│ │ └── MapToImport02.xodr
| ├── AssetsToImport

View File

@ -18,29 +18,12 @@ import os
import shutil
import subprocess
@contextmanager
def pushd(directory):
"""Context manager to temporally change working directory."""
cwd = os.getcwd()
try:
os.chdir(directory)
yield
finally:
os.chdir(cwd)
# Global variables
IMPORT_SETTING_FILENAME = "importsetting.json"
SCRIPT_NAME = os.path.basename(__file__)
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
CARLA_ROOT_PATH = ""
# Temporary get into current script folder to find Carla root path
with pushd(SCRIPT_DIR):
# Go two directories above the current one
os.chdir(os.path.pardir)
os.chdir(os.path.pardir)
CARLA_ROOT_PATH = os.getcwd()
# Go two directories above the current script
CARLA_ROOT_PATH = os.path.normpath(SCRIPT_DIR + '/../..')
def get_packages_json_list(folder):

View File

@ -99,3 +99,5 @@ for developers:
Prettify code files. Run uncrustify on C++ files or AutoPEP8 on Python
files. To prettify a single file, use: make pretty ARGS=-f/path/to/file.