Skip to content

Commit

Permalink
Fix: Build error
Browse files Browse the repository at this point in the history
  • Loading branch information
nutti committed Aug 13, 2023
1 parent 3f1a83e commit 0fec86a
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 36 deletions.
2 changes: 2 additions & 0 deletions src/fake_bpy_module/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,8 @@ def _analyze_by_file(self, filename: str) -> 'SectionInfo':
return section_none_removed

def analyze(self, filenames: List[str]) -> 'AnalysisResult':
# TODO: Add assertion.

result = AnalysisResult()
for f in filenames:
info = self._analyze_by_file(f)
Expand Down
37 changes: 37 additions & 0 deletions src/fake_bpy_module/support.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from typing import List

SUPPORTED_TARGET: List[str] = [
"blender",
"upbge"
]

SUPPORTED_STYLE_FORMAT: List[str] = [
"none",
"pep8"
]

SUPPORTED_MOD_BLENDER_VERSION: List[str] = [
"2.78", "2.79",
"2.80", "2.81", "2.82", "2.83",
"2.90", "2.91", "2.92", "2.93",
"3.0", "3.1", "3.2", "3.3", "3.4",
"latest"
]

SUPPORTED_MOD_UPBGE_VERSION: List[str] = [
"0.2.5",
"latest"
]

SUPPORTED_BLENDER_VERSION: List[str] = [
"2.78", "2.79",
"2.80", "2.81", "2.82", "2.83",
"2.90", "2.91", "2.92", "2.93",
"3.0", "3.1", "3.2", "3.3", "3.4",
"latest"
]

SUPPORTED_UPBGE_VERSION: List[str] = [
"0.2.5",
"latest"
]
48 changes: 12 additions & 36 deletions src/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,6 @@
import fake_bpy_module as fbm

INPUT_DIR: str = "."
SUPPORTED_TARGET: List[str] = ["blender", "upbge"]
SUPPORTED_STYLE_FORMAT: List[str] = ["none", "pep8"]
SUPPORTED_MOD_BLENDER_VERSION: List[str] = [
"2.78", "2.79",
"2.80", "2.81", "2.82", "2.83",
"2.90", "2.91", "2.92", "2.93",
"3.0", "3.1", "3.2", "3.3", "3.4",
"latest"
]
SUPPORTED_MOD_UPBGE_VERSION: List[str] = [
"0.2.5",
"latest"
]
SUPPORTED_BLENDER_VERSION: List[str] = [
"2.78", "2.79",
"2.80", "2.81", "2.82", "2.83",
"2.90", "2.91", "2.92", "2.93",
"3.0", "3.1", "3.2", "3.3", "3.4",
"latest"
]
SUPPORTED_UPBGE_VERSION: List[str] = [
"0.2.5",
"latest"
]
MOD_FILES_DIR: str = os.path.dirname(os.path.abspath(__file__))


Expand Down Expand Up @@ -257,51 +233,51 @@ def parse_options(config: 'fbm.PackageGeneratorConfig'):
if args.output_dir:
config.output_dir = args.output_dir

if args.style_format in SUPPORTED_STYLE_FORMAT:
if args.style_format in fbm.support.SUPPORTED_STYLE_FORMAT:
config.style_format = args.style_format
else:
raise RuntimeError(
f"Not supported style format {args.style_format}. "
f"(Supported Style Format: {SUPPORTED_STYLE_FORMAT})")
f"(Supported Style Format: {fbm.support.SUPPORTED_STYLE_FORMAT})")

if args.target in SUPPORTED_TARGET:
if args.target in fbm.support.SUPPORTED_TARGET:
config.target = args.target
else:
raise RuntimeError(
f"Not supported target {args.target}."
f"(Supported Target: {SUPPORTED_TARGET})")
f"(Supported Target: {fbm.support.SUPPORTED_TARGET})")

if args.target == "blender":
if args.target_version in SUPPORTED_BLENDER_VERSION:
if args.target_version in fbm.support.SUPPORTED_BLENDER_VERSION:
config.target_version = args.target_version
else:
raise RuntimeError(
f"Not supported blender version {args.target_version}. "
f"(Supported Version: {SUPPORTED_BLENDER_VERSION})")
f"(Supported Version: {fbm.support.SUPPORTED_BLENDER_VERSION})")

if args.target == "upbge":
if args.target_version in SUPPORTED_UPBGE_VERSION:
if args.target_version in fbm.support.SUPPORTED_UPBGE_VERSION:
config.target_version = args.target_version
else:
raise RuntimeError(
f"Not supported upbge version {args.target_version}. "
f"(Supported Version: {SUPPORTED_UPBGE_VERSION})")
f"(Supported Version: {fbm.support.SUPPORTED_UPBGE_VERSION})")

if args.mod_version:
if config.target == "blender":
if args.mod_version in SUPPORTED_MOD_BLENDER_VERSION:
if args.mod_version in fbm.support.SUPPORTED_MOD_BLENDER_VERSION:
config.mod_version = args.mod_version
else:
raise RuntimeError(
f"Not supported mod version {args.mod_version}. "
f"(Supported Version: {SUPPORTED_MOD_BLENDER_VERSION})")
f"(Supported Version: {fbm.support.SUPPORTED_MOD_BLENDER_VERSION})")
elif config.target == "upbge":
if args.mod_version in SUPPORTED_MOD_UPBGE_VERSION:
if args.mod_version in fbm.support.SUPPORTED_MOD_UPBGE_VERSION:
config.mod_version = args.mod_version
else:
raise RuntimeError(
f"Not supported mod version {args.mod_version}. "
f"(Supported Version: {SUPPORTED_MOD_UPBGE_VERSION})")
f"(Supported Version: {fbm.support.SUPPORTED_MOD_UPBGE_VERSION})")

if args.output_log_level:
ARG_TO_LOG_LEVEL = {
Expand Down

0 comments on commit 0fec86a

Please sign in to comment.