|
@@ -5,7 +5,7 @@ from toolset.utils.metadata_helper import gather_frameworks, gather_langauges
|
|
|
|
|
|
|
|
|
|
class Scaffolding:
|
|
class Scaffolding:
|
|
- def __init__(self):
|
|
|
|
|
|
+ def __init__(self, benchmarker_config):
|
|
print("""
|
|
print("""
|
|
-------------------------------------------------------------------------------
|
|
-------------------------------------------------------------------------------
|
|
This wizard is intended to help build the scaffolding required for a new
|
|
This wizard is intended to help build the scaffolding required for a new
|
|
@@ -16,6 +16,8 @@ class Scaffolding:
|
|
-------------------------------------------------------------------------------"""
|
|
-------------------------------------------------------------------------------"""
|
|
)
|
|
)
|
|
|
|
|
|
|
|
+ self.benchmarker_config = benchmarker_config
|
|
|
|
+
|
|
try:
|
|
try:
|
|
self.__gather_display_name()
|
|
self.__gather_display_name()
|
|
self.__gather_language()
|
|
self.__gather_language()
|
|
@@ -41,10 +43,10 @@ class Scaffolding:
|
|
self.name = self.display_name.lower()
|
|
self.name = self.display_name.lower()
|
|
|
|
|
|
def __prompt_display_name(self):
|
|
def __prompt_display_name(self):
|
|
- self.display_name = input("Name: ").strip()
|
|
|
|
|
|
+ self.display_name = raw_input("Name: ").strip()
|
|
|
|
|
|
found = False
|
|
found = False
|
|
- for framework in gather_frameworks():
|
|
|
|
|
|
+ for framework in gather_frameworks(config=self.benchmarker_config):
|
|
if framework.lower() == self.display_name.lower():
|
|
if framework.lower() == self.display_name.lower():
|
|
found = True
|
|
found = True
|
|
|
|
|
|
@@ -66,7 +68,7 @@ class Scaffolding:
|
|
self.__prompt_language()
|
|
self.__prompt_language()
|
|
|
|
|
|
def __prompt_language(self):
|
|
def __prompt_language(self):
|
|
- self.language = input("Language: ").strip()
|
|
|
|
|
|
+ self.language = raw_input("Language: ").strip()
|
|
|
|
|
|
known_languages = gather_langauges()
|
|
known_languages = gather_langauges()
|
|
language = None
|
|
language = None
|
|
@@ -103,8 +105,8 @@ class Scaffolding:
|
|
return self.language
|
|
return self.language
|
|
|
|
|
|
def __prompt_confirm_new_language(self, known_languages):
|
|
def __prompt_confirm_new_language(self, known_languages):
|
|
- self.confirm_new_lang = input("Create New Language '%s' (y/n): " %
|
|
|
|
- self.language).strip().lower()
|
|
|
|
|
|
+ self.confirm_new_lang = raw_input("Create New Language '%s' (y/n): " %
|
|
|
|
+ self.language).strip().lower()
|
|
return self.confirm_new_lang == 'y' or self.confirm_new_lang == 'n'
|
|
return self.confirm_new_lang == 'y' or self.confirm_new_lang == 'n'
|
|
|
|
|
|
def __gather_approach(self):
|
|
def __gather_approach(self):
|
|
@@ -128,7 +130,7 @@ class Scaffolding:
|
|
valid = self.__prompt_approach()
|
|
valid = self.__prompt_approach()
|
|
|
|
|
|
def __prompt_approach(self):
|
|
def __prompt_approach(self):
|
|
- self.approach = input("Approach [1/2]: ").strip()
|
|
|
|
|
|
+ self.approach = raw_input("Approach [1/2]: ").strip()
|
|
if self.approach == '1':
|
|
if self.approach == '1':
|
|
self.approach = 'Realistic'
|
|
self.approach = 'Realistic'
|
|
if self.approach == '2':
|
|
if self.approach == '2':
|
|
@@ -162,7 +164,7 @@ class Scaffolding:
|
|
self.__gather_platform()
|
|
self.__gather_platform()
|
|
|
|
|
|
def __prompt_classification(self):
|
|
def __prompt_classification(self):
|
|
- self.classification = input("Classification [1/2/3]: ").strip()
|
|
|
|
|
|
+ self.classification = raw_input("Classification [1/2/3]: ").strip()
|
|
if self.classification == '1':
|
|
if self.classification == '1':
|
|
self.classification = 'Fullstack'
|
|
self.classification = 'Fullstack'
|
|
if self.classification == '2':
|
|
if self.classification == '2':
|
|
@@ -189,7 +191,7 @@ class Scaffolding:
|
|
self.__prompt_platform()
|
|
self.__prompt_platform()
|
|
|
|
|
|
def __prompt_platform(self):
|
|
def __prompt_platform(self):
|
|
- self.platform = input("Platform (optional): ").strip()
|
|
|
|
|
|
+ self.platform = raw_input("Platform (optional): ").strip()
|
|
if self.platform == '':
|
|
if self.platform == '':
|
|
self.platform = 'None'
|
|
self.platform = 'None'
|
|
|
|
|
|
@@ -210,7 +212,7 @@ class Scaffolding:
|
|
valid = self.__prompt_orm()
|
|
valid = self.__prompt_orm()
|
|
|
|
|
|
def __prompt_orm(self):
|
|
def __prompt_orm(self):
|
|
- self.orm = input("ORM [1/2/3]: ").strip()
|
|
|
|
|
|
+ self.orm = raw_input("ORM [1/2/3]: ").strip()
|
|
if self.orm == '1':
|
|
if self.orm == '1':
|
|
self.orm = 'Full'
|
|
self.orm = 'Full'
|
|
if self.orm == '2':
|
|
if self.orm == '2':
|
|
@@ -233,7 +235,7 @@ class Scaffolding:
|
|
self.__prompt_webserver()
|
|
self.__prompt_webserver()
|
|
|
|
|
|
def __prompt_webserver(self):
|
|
def __prompt_webserver(self):
|
|
- self.webserver = input("Webserver (optional): ").strip()
|
|
|
|
|
|
+ self.webserver = raw_input("Webserver (optional): ").strip()
|
|
if self.webserver == '':
|
|
if self.webserver == '':
|
|
self.webserver = 'None'
|
|
self.webserver = 'None'
|
|
|
|
|
|
@@ -251,7 +253,7 @@ class Scaffolding:
|
|
self.__prompt_versus()
|
|
self.__prompt_versus()
|
|
|
|
|
|
def __prompt_versus(self):
|
|
def __prompt_versus(self):
|
|
- self.versus = input("Versus (optional): ").strip()
|
|
|
|
|
|
+ self.versus = raw_input("Versus (optional): ").strip()
|
|
if self.versus == '':
|
|
if self.versus == '':
|
|
self.versus = 'None'
|
|
self.versus = 'None'
|
|
|
|
|
|
@@ -283,7 +285,7 @@ class Scaffolding:
|
|
print('Aborting')
|
|
print('Aborting')
|
|
|
|
|
|
def __prompt_confirmation(self):
|
|
def __prompt_confirmation(self):
|
|
- self.confirmation = input("Initialize [y/n]: ").strip().lower()
|
|
|
|
|
|
+ self.confirmation = raw_input("Initialize [y/n]: ").strip().lower()
|
|
return self.confirmation == 'y' or self.confirmation == 'n'
|
|
return self.confirmation == 'y' or self.confirmation == 'n'
|
|
|
|
|
|
def __build_scaffolding(self):
|
|
def __build_scaffolding(self):
|
|
@@ -292,7 +294,8 @@ class Scaffolding:
|
|
self.__edit_scaffold_files()
|
|
self.__edit_scaffold_files()
|
|
|
|
|
|
def __create_test_folder(self):
|
|
def __create_test_folder(self):
|
|
- self.language_dir = os.path.join("frameworks", self.language)
|
|
|
|
|
|
+ self.language_dir = os.path.join(self.benchmarker_config.fwroot,
|
|
|
|
+ "frameworks", self.language)
|
|
self.test_dir = os.path.join(self.language_dir, self.name)
|
|
self.test_dir = os.path.join(self.language_dir, self.name)
|
|
|
|
|
|
if os.path.exists(self.test_dir):
|
|
if os.path.exists(self.test_dir):
|
|
@@ -302,7 +305,8 @@ class Scaffolding:
|
|
return True
|
|
return True
|
|
|
|
|
|
def __copy_scaffold_files(self):
|
|
def __copy_scaffold_files(self):
|
|
- self.scaffold_dir = os.path.join("toolset", "setup", "scaffolding")
|
|
|
|
|
|
+ self.scaffold_dir = os.path.join(self.benchmarker_config.fwroot,
|
|
|
|
+ "toolset", "scaffolding")
|
|
copytree(self.scaffold_dir, self.test_dir)
|
|
copytree(self.scaffold_dir, self.test_dir)
|
|
|
|
|
|
def __edit_scaffold_files(self):
|
|
def __edit_scaffold_files(self):
|
|
@@ -343,11 +347,8 @@ class Scaffolding:
|
|
frameworks
|
|
frameworks
|
|
└─── %s
|
|
└─── %s
|
|
└─── %s
|
|
└─── %s
|
|
- ├─── .gitignore
|
|
|
|
├─── benchmark_config.json
|
|
├─── benchmark_config.json
|
|
├─── README.md
|
|
├─── README.md
|
|
- ├─── setup.sh
|
|
|
|
- ├─── setup_mysql.sh
|
|
|
|
└─── source_code
|
|
└─── source_code
|
|
|
|
|
|
The next step is to read through your README.md and follow the instructions
|
|
The next step is to read through your README.md and follow the instructions
|