def __init__(self, item, mirror='GERMANY', parent=None): QThread.__init__(self, parent) config = Config.Instance() base_path = os.path.expanduser(config['PATHS']['BASE_PATH']) mirror_url = MIRRORS[mirror or 'GERMANY'] dirname = item['dir'] filename = item['filename'] self.temp_dir = os.path.join(base_path, 'temp') self.download_url = mirror_url + dirname + filename self.save_path = os.path.join(self.temp_dir, filename)
def __init__(self, file_path, should_remove_archive=False, parent=None): QThread.__init__(self, parent) self.file_path = file_path self.should_remove_archive = should_remove_archive config = Config.Instance() base_path = os.path.expanduser(config['PATHS']['BASE_PATH']) self.wads_path = os.path.expanduser(config['PATHS']['WADS_PATH']) # remove file extension (.zip or whatever) pattern = re.compile(r'\.[a-z0-9]+$') self.file_dir = pattern.sub('', pathlib.Path(file_path).name) self.temp_extraction_path = os.path.join(base_path, 'temp', self.file_dir)
def __init__(self, **params): super(WadLoaderWorker, self).__init__() config = Config.Instance() self.path = os.path.expanduser(config['PATHS']['WADS_PATH']) self.exts = ['.wad', '.pk3', '.deh', '.bex']
def __init__(self): super(SourcePortLoaderWorker, self).__init__() config = Config.Instance() config = Config.Instance() base_path = os.path.expanduser(config['PATHS']['BASE_PATH']) self.path = os.path.join(base_path, 'source_ports.ini')
from PyQt5 import QtWidgets, uic from core.utils.mvcimporter import * from app.AppContext import * from app.config import Config from app.helpers.StackedWidgetSelector import * class Ui(QtWidgets.QMainWindow): def __init__(self, appctxt): super(Ui, self).__init__() template_file_path = appctxt.get_resource('template/wadlauncher.ui') uic.loadUi(template_file_path, self) self.show() if __name__ == '__main__': appctxt = AppContext.Instance() config = Config.Instance() window = Ui(appctxt) models, controllers = mvcimport(os.path.dirname(os.path.abspath(__file__)), window) display_widget(window, WidgetIndices.WELCOME) exit_code = appctxt.app.exec_() sys.exit(exit_code)
def __init__(self): super(CategoryLoaderWorker, self).__init__() config = Config.Instance() base_path = os.path.expanduser(config['PATHS']['BASE_PATH']) self.path = os.path.join(base_path, 'user_categories.ini')
def __init__(self, items): super(CategorySaverWorker, self).__init__() config = Config.Instance() base_path = os.path.expanduser(config['PATHS']['BASE_PATH']) self.path = os.path.join(base_path, 'user_categories.ini') self.items = [asdict(item) for item in items]
def __init__(self, dir): super(WadImporterWorker, self).__init__() config = Config.Instance() self.path = os.path.expanduser(config['PATHS']['WADS_PATH']) self.exts = ['.wad', '.pk3', '.deh', '.bex'] self.dir = dir