Few fixes
This commit is contained in:
parent
070aae5a9c
commit
7ba7587c78
|
@ -109,7 +109,7 @@ Import
|
||||||
│ │ ├── LaneMarking1_Spec.png
|
│ │ ├── LaneMarking1_Spec.png
|
||||||
│ │ ├── MapToImport01.fbx
|
│ │ ├── MapToImport01.fbx
|
||||||
│ │ └── MapToImport01.xodr
|
│ │ └── MapToImport01.xodr
|
||||||
| └── MapToImport02
|
| ├── MapToImport02
|
||||||
│ │ ├── MapToImport02.fbx
|
│ │ ├── MapToImport02.fbx
|
||||||
│ │ └── MapToImport02.xodr
|
│ │ └── MapToImport02.xodr
|
||||||
| ├── AssetsToImport
|
| ├── AssetsToImport
|
||||||
|
|
|
@ -18,29 +18,12 @@ import os
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
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
|
# Global variables
|
||||||
IMPORT_SETTING_FILENAME = "importsetting.json"
|
IMPORT_SETTING_FILENAME = "importsetting.json"
|
||||||
SCRIPT_NAME = os.path.basename(__file__)
|
SCRIPT_NAME = os.path.basename(__file__)
|
||||||
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
|
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
|
||||||
CARLA_ROOT_PATH = ""
|
# Go two directories above the current script
|
||||||
# Temporary get into current script folder to find Carla root path
|
CARLA_ROOT_PATH = os.path.normpath(SCRIPT_DIR + '/../..')
|
||||||
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()
|
|
||||||
|
|
||||||
|
|
||||||
def get_packages_json_list(folder):
|
def get_packages_json_list(folder):
|
||||||
|
|
|
@ -99,3 +99,5 @@ for developers:
|
||||||
|
|
||||||
Prettify code files. Run uncrustify on C++ files or AutoPEP8 on Python
|
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.
|
files. To prettify a single file, use: make pretty ARGS=-f/path/to/file.
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue