Beispiel #1
0
def _do_qt_init():
    """
    set up the QT app
    Returns: QtGui.Application

    """
    app = QtWidgets.QApplication([])
    return app
Beispiel #2
0
def app_init(splash_image='lubmermill.jpg'):
    from cgl.core.path import image_path
    app_ = QtWidgets.QApplication([])
    splash_pix = QtGui.QPixmap(image_path(splash_image))
    splash_ = QtWidgets.QSplashScreen(splash_pix, QtCore.Qt.WindowStaysOnTopHint)
    splash_.setMask(splash_pix.mask())
    splash_.show()
    app_.setStyleSheet(load_style_sheet())
    return app_, splash_
Beispiel #3
0
            ' Sync> Pull From Server\n'
            'and you will start syncing folders')
        dialog.exec_()
        # set_up_syncthing(folders=[os.path.join(self.default_root, '_config', 'cgl_tools')])


def create_user_globals(user_globals, globals_path):
    if user_globals:
        if not os.path.exists(os.path.dirname(user_globals)):
            os.makedirs(os.path.dirname(user_globals))
        d = {
            "globals": globals_path,
            "previous_path": "",
            "previous_paths": {},
            "methodology": "local",
            "my_tasks": {}
        }
        print "saving user_globals to %s" % user_globals
        read_write.save_json(user_globals, d)
    else:
        print 'No Root Defined, cannot save user globals'


if __name__ == "__main__":
    # from cgl.core.utils import load_style_sheet
    app = QtWidgets.QApplication([])
    #app = QtWidgets.QApplication([])
    form = QuickSync()
    form.show()
    app.exec_()
Beispiel #4
0
    def copy_settings(self):
        """
        Settings for pycharm editor will already be setup by onboarding setup script
        :return:
        """
        githook_file = os.path.join(ROOT, 'resources', 'githooks', 'post-checkout')
        destination_file = os.path.join(ROOT, '.git', 'hooks', 'post-checkout')
        shutil.copy(githook_file, destination_file)

    def edit_xml(self, user_id, project_id):
        xml_file = os.path.join(ROOT, 'resources', 'pycharm_setup', 'workspace.xml')
        docs = load_xml(xml_file)
        for item in docs['project']['component']:
            if item['@name'] == "TaskManager":
                item['servers']['Generic']['username'] = user_id
                # print item['servers']['Generic']['username']
                for element in item['servers']['Generic']['option']:
                    if element['@name'] == "templateVariables":
                        element['list']['TemplateVariable'][0]['option'][1]['@value'] = project_id
                       # print element['list']['TemplateVariable'][0]['option'][1]['@value']
        idea_xml = os.path.join(ROOT, '.idea', 'workspace.xml')
        save_xml(idea_xml, docs)


if __name__ == "__main__":
    app = QtWidgets.QApplication(sys.argv)
    s = SetupGUI()
    s.show()
    app.exec_()