def checkin_from_path(self, search_key, context, description, explicit_paths=None): if explicit_paths: update_versionless = bool(self.checkin_options_widget.updateVersionlessCheckBox.isChecked()) repo = self.get_current_repo() file_types = [] file_names = [] file_paths = [] exts = [] file_sizes = [] for path in explicit_paths: file_types.append('main') file_names.append(gf.extract_filename(path)) exts.append(gf.extract_extension(path)[0]) file_path = gf.form_path(path) file_paths.append(file_path) file_sizes.append(gf.get_st_size(file_path)) mode = 'inplace' create_icon = False if context == 'icon': create_icon = True return tc.checkin_file( search_key=search_key, context=context, description=description, version=None, update_versionless=update_versionless, file_types=file_types, file_names=file_names, file_paths=file_paths, file_sizes=file_sizes, exts=exts, keep_file_name=False, repo_name=repo, mode=mode, create_icon=create_icon )
def checkin_from_droplist(self, search_key, context, description): selected_items = self.ui_drop_plate.dropTreeWidget.selectedItems() if selected_items: update_versionless = bool(self.checkin_options_widget.updateVersionlessCheckBox.isChecked()) repo = self.get_current_repo() file_types = [] file_names = [] file_paths = [] exts = [] file_sizes = [] for item in selected_items: file_types.append('main') file_names.append(item.text(0)) file_path = gf.form_path(item.text(2) + '/' + item.text(0)) file_paths.append(file_path) exts.append(item.data(1, QtCore.Qt.UserRole)) file_sizes.append(gf.get_st_size(file_path)) mode = 'inplace' return tc.checkin_file( search_key=search_key, context=context, description=description, version=None, update_versionless=update_versionless, file_types=file_types, file_names=file_names, file_paths=file_paths, file_sizes=file_sizes, exts=exts, keep_file_name=False, repo_name=repo, mode=mode, create_icon=False )