def tab_save(self): # TODO Update the GUI to show all selected levels tab = self.tabBar() tab = tab.currentIndex() setting = Setup() if tab == 1: print('Save Network') else: # Save projects Dataa editor = self.lineEditUnreal.text() project = self.lineEditProject.text() scene = self.lineEditSubfolder.text() if not setting.last_job_run(): self.data_base_save() self.data = TableProgram() self.data.write_data_path(editor, project, scene) self.data.write_data_levels() # Save State Data csv_state = self.csv_checkBox_enable csv_item = 'False' if QtWidgets.QAbstractButton.isChecked(csv_state): csv_item = self.csv_comboBox.currentText() self.data.csv_data(csv_item) ViewTabSetup.close(self)
def __init__(self): super(TableProgram, self).__init__() data = Setup() self.base_sql = data.last_job_run() self.bd_exist = os.path.exists(self.base_sql) self.bd = sqlite3.connect(self.base_sql) if not self.bd_exist: self.create_all_tables()
def data_base_save(self): options = QFileDialog.Options() directory = join(expanduser('~'), 'BBLUE4') database = QFileDialog.getSaveFileName(self, 'Save your projects', directory=directory, filter='*.db', options=options) edit = Setup() edit.last_job_add(database[0])
def __init__(self, parent=None): super(ViewTabHelp, self).__init__(parent) self.setupUi(self) self.data = Setup() # Version Panel url_octi = self.label_url_octicons url_website = self.label_url_website url_octi.setText('''<a href='https://octicons.github.com/'>Github's Icons - Octicons</a>''') url_website.setText('''<a href='https://github.com/stilobique/BatchBuildLightUE4/'>Github Depot</a>''') self.pushButtonClose.clicked.connect(self.close)
all indication.""" # 1/ Check the number version -> Valid # 2/ Propose a news number version -> Valid # 3/ Edit the INI file and pack-it -> Valid # 4/ Upload on Github :) . import subprocess import fileinput import re from os.path import dirname, join from BatchLightUE4.Controllers.Setup import Setup # All Variable init = Setup() setup_file = join( 'E:\WORKS\Git\BatchBuildLightUE4\BatchLightUE4\Controllers\Setup.py') # str_find = re.search('number = \'\' ', setup_file) package = dirname(__file__) + '/packages.bat' print('Actual Version : ', init.number) nbr_version = input('Number Version : ') with fileinput.FileInput(setup_file, inplace=True) as file: for line in file: # print(re.search(r"number = '(.)*'", 'wesh = ', line.rstrip())) str_old = r"number = '" + init.number + "'" str_new = r"number = '" + nbr_version + "'" print(line.rstrip().replace(str_old, str_new))
def __init__(self, parent=None): """ Main Window, principal view, this windows can show all level, access on many option -path setup, network, log... """ super(MainWindows, self).__init__(parent) self.setupUi(self) # Setup settings base self.data = Setup() self.job = self.data.last_job_run() self.checkBoxLevels = {} # Triggered Menu # File Menu self.actionLast_project.triggered.connect(self.open_save) self.actionExit.triggered.connect(self.close) # Setup and Option Menu self.actionProject.triggered.connect(self.view_project) self.actionNetworks.triggered.connect(lambda: self.view_project(1)) self.actionCSV.triggered.connect(lambda: self.view_project(2)) # Log Panel self.actionShow_log_folder.triggered.connect(self.view_log) self.actionClean_Log.triggered.connect(self.view_log) # Help Tab self.actionAbout.triggered.connect(self.view_help) self.actionShortcut.triggered.connect(lambda: self.view_help(1)) self.pushLevelsSelect.clicked.connect(lambda: self.select_level(True)) self.pushLevelsDeselect.clicked.connect(self.select_level) self.toolLevelsEdit.clicked.connect(lambda: self.view_project(0)) # Generate all Checkbox Levels. # TODO Refactoring the Check perforce (not OO and fonctional only # with Perforce ! Need to be think with Subversion and Git. if self.job: self.data = TableProgram() levels = self.data.select_levels() level_checkbox = self.data.select_levels(state=2) self.csv = self.data.csv_data() i = 0 while i < len(level_checkbox): key = level_checkbox[i][1] key_folder = basename(dirname(level_checkbox[i][2])) self.checkBoxLevels[key] = QtWidgets.QCheckBox(key) self.checkBoxLevels[key].setObjectName(key) csv_value = self.csv[0] if csv_value != str('False'): # TODO Add a progress bar, the the soft check many levels # the request can be long. for level_name in levels: if key_folder in level_name[2]: p4 = perforce.connect() filename = perforce.Revision(p4, level_name[2]) if 'otherOpen' in filename._p4dict: bubble_msg = filename._p4dict.get('otherOpen0') tooltip = bubble_msg self.checkBoxLevels[key].setToolTip(tooltip) self.checkBoxLevels[key].setEnabled(False) self.allLevelsCheck.addWidget(self.checkBoxLevels[key]) self.allLevelsCheck.contentsMargins() i = i + 1 if 'False' not in self.csv[0]: self.checkBoxSubmit.setEnabled(True) self.pushToolsBuils.clicked.connect(self.view_rendering) self.pushToolsBuils.setToolTip(self.pushToolsBuils.statusTip())
def __init__(self): super(ViewTabSetup, self).__init__() self.setupUi(self) self.data = Setup() self.job = self.data.last_job_run() if self.job: # Project Tab self.data = TableProgram() data_paths = self.data.select_path(1) self.ue4_path = data_paths[0][1] self.ue4_project = data_paths[0][2] self.dir_project = os.path.dirname(self.ue4_project) self.scene = data_paths[0][3] self.levels_path = join(self.dir_project, 'content', self.scene) self.levels_path = os.path.abspath(self.levels_path) self.data_level = self.project_list_level(self.levels_path) # CSV Tab self.data_csv = self.data.csv_data() if self.data_csv[0] == 'False' or self.data_csv is None: self.csv_boolean = 0 self.csv_software = 2 else: self.csv_boolean = 2 self.csv_software = self.data_csv[0] else: news_DB = True self.ue4_path = self.data.base('editor') self.ue4_project = self.data.base('project') self.scene = self.data.base('sub folder') self.data_level = [] self.csv_boolean = 0 self.csv_software = 1 # Project Panel self.levels_list = QtGui.QStandardItemModel() self.project_tree_generate(self.levels_list, self.data_level) self.treeViewLevels.setModel(self.levels_list) self.treeViewLevels.clicked.connect(self.project_update_level) self.levels_list.setHorizontalHeaderLabels([self.tr('Level Name')]) self.pushPathOpenUnreal.clicked.connect(lambda: self.open_save(1)) self.lineEditUnreal.setText(self.ue4_path) self.pushPathOpenProject.clicked.connect(lambda: self.open_save(2)) self.lineEditProject.setText(self.ue4_project) name = project_name(self.lineEditProject.text()) self.lineEditProjectName.setText(name) self.lineEditSubfolder.setText(self.scene) # Network Panel # TODO Make all network options # CSV Panel """All option about the CSV options.""" self.csv_checkBox_enable.setCheckState(self.csv_boolean) self.csv_checkBox_enable.clicked.connect(self.csv_enable) if self.csv_software: self.csv_comboBox.itemText(2) # Button Box, Save and Cancel btn = QtWidgets.QDialogButtonBox # Restore Default # Save self.buttonBoxProjects.button(btn.Save).clicked.connect(self.tab_save) self.buttonBoxCSV.button(btn.Save).clicked.connect(self.tab_save) # Close Event self.buttonBoxProjects.button(btn.Cancel).clicked.connect(self.close) self.buttonBoxNetwork.button(btn.Cancel).clicked.connect(self.close) self.buttonBoxCSV.button(btn.Cancel).clicked.connect(self.close)
"""Generate a Packages with the update version, launch this file and follow all indication.""" # 1/ Check the number version -> Valid # 2/ Propose a news number version -> Valid # 3/ Edit the INI file and pack-it -> Valid # 4/ Upload on Github :) . import subprocess from os.path import dirname from BatchLightUE4.Controllers.Setup import Setup # All Variable init = Setup() package = dirname(__file__) + '/packages.bat' print('Actual Version : ', init.version()) nbr_version = input('Number Version : ') init.version(update=nbr_version) subprocess.call(package)