当前位置: 首页>>代码示例>>Python>>正文


Python main.main方法代码示例

本文整理汇总了Python中main.main方法的典型用法代码示例。如果您正苦于以下问题:Python main.main方法的具体用法?Python main.main怎么用?Python main.main使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在main的用法示例。


在下文中一共展示了main.main方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: selectPack

# 需要导入模块: import main [as 别名]
# 或者: from main import main [as 别名]
def selectPack():
    global pack
    pack = filedialog.askopenfilename(initialdir = "./",title = "Select Pack",filetypes = (("resource pack","*.zip"),("all files","*.*")))
    if(pack):
        root.withdraw()
        convert = main(pack[:-4])
        if(convert == -1):
            print ("this pack is already compatible with 1.13")
            root.deiconify()
            center_window(root, 270, 120)
            messagebox.showwarning(title='warning', message="This pack is already compatible with 1.13, please select other!")
        elif(convert == 0):
            print ("please set it manually")
            res_win.deiconify()
            center_window(res_win, 270, 80)
            messagebox.showwarning(title='warning', message="Fail to detect the pack's resolution, please set it manually!")
        else:
            print ("next one?")
            root.deiconify()
            center_window(root, 270, 120)
            messagebox.showinfo(title='success', message='Conversion is Done!')
            return False

    else:
        print ('select pack to start conversion') 
开发者ID:icrdr,项目名称:Resource-Pack-Converter,代码行数:27,代码来源:convert_tool.py

示例2: leftClickHandler

# 需要导入模块: import main [as 别名]
# 或者: from main import main [as 别名]
def leftClickHandler(self, event):
        """Handle LMB-click events to add/remove control points & spaces. """
        
        # ensure focus on display canvas to recieve mouse clicks
        self.display.focus_set()
        
        # perform correct operation, dependent on which toggle button is active
        
        # add new control points (max = 3)
        if self.cps_button.getIsActive():
            if self.__is_verbose: print "INFO: Add Control Point"
            self.__is_saved = False
            
            this_cp_id = self.__control_points.getCurrentBox()
            this_cp = self.__control_points.boxes[this_cp_id]
            this_cp.updatePoints(event.x, event.y)
        
        # add new parking space
        elif self.spaces_button.getIsActive():
            if self.__is_verbose: print "INFO: Add Parking Space"
            self.__is_saved = False
            
            this_space_id = self.__parking_spaces.getCurrentBox()
            this_space = self.__parking_spaces.boxes[this_space_id]
            this_space.updatePoints(event.x, event.y)
            
        # do nothing -- ignore LMB clicks
        else:
            if self.__is_verbose: print "INFO: Just clicking LMB merrily =D"

        # return focus to the main frame for key-press events
        self.focus_set()
        
    # --------------------------------------------------------------------------
    #   RMB Event Handler
    # -------------------------------------------------------------------------- 
开发者ID:Humpheh,项目名称:PiPark,代码行数:38,代码来源:pipark_setup.py

示例3: rightClickHandler

# 需要导入模块: import main [as 别名]
# 或者: from main import main [as 别名]
def rightClickHandler(self, event):
        """Handle RMB-click events to add/remove control points & spaces. """
        
        # ensure focus is set to the display canvas
        self.display.focus_set()
        
        # perform correct operation, dependent on which toggle button is active
        if self.cps_button.getIsActive():
            if self.__is_verbose: print "INFO: Remove Control Point"
            self.__is_saved = False
            
            self.__control_points.boxes[self.__control_points.getCurrentBox()].clear()
            self.__control_points.boxes[self.__control_points.getCurrentBox()].deleteRectangle(self.display)
            
        elif self.spaces_button.getIsActive():
            if self.__is_verbose: print "INFO: Remove parking space"
            self.__is_saved = False
            
            self.__parking_spaces.boxes[self.__parking_spaces.getCurrentBox()].clear()
            self.__parking_spaces.boxes[self.__parking_spaces.getCurrentBox()].deleteRectangle(self.display)
            
        else:
            if self.__is_verbose: print "INFO: Just clicking RMB merrily =)"
        
        # return focus to the main frame for key-press events
        self.focus_set()


# ==============================================================================
#
#  Button Handlers
#
# ============================================================================== 
开发者ID:Humpheh,项目名称:PiPark,代码行数:35,代码来源:pipark_setup.py

示例4: __init__

# 需要导入模块: import main [as 别名]
# 或者: from main import main [as 别名]
def __init__(self):
        self._load_sub_menus(main()) 
开发者ID:krahsdevil,项目名称:Retropie-CRT-Edition,代码行数:4,代码来源:index.py

示例5: _restart_control

# 需要导入模块: import main [as 别名]
# 或者: from main import main [as 别名]
def _restart_control(self):
        p_bPartial = True
        if len(self.m_lSubMenus) == 1: p_bPartial = False
        # add submenu restart control to the list
        try:
            p_bCheck = False
            p_lCtrl = self.m_lSubMenus[-1].m_lRestart
            for item in self.m_lRestart:
                if p_lCtrl[0] == item[0]:
                    item[1] = p_lCtrl[1]
                    p_bCheck = True
            # add to the list if not exist
            if not p_bCheck: 
                self.m_lRestart.append(self.m_lSubMenus[-1].m_lRestart)
        except:
            pass

        # show es restart icon if needed in current submenu
        # if any submenu requires es restart, icon will appear on main page
        p_bCheck = False
        if p_bPartial:
            try:
                name = self.m_lSubMenus[-1].m_lRestart[0]
                for item in self.m_lRestart:
                    if item[0] == name:
                        if item[1] == True: p_bCheck = True
            except:
                p_bCheck = False
        else:
            for item in self.m_lRestart:
                if item[1] == True: p_bCheck = True
        self.m_bRestart = p_bCheck 
开发者ID:krahsdevil,项目名称:Retropie-CRT-Edition,代码行数:34,代码来源:index.py

示例6: _reboot_control

# 需要导入模块: import main [as 别名]
# 或者: from main import main [as 别名]
def _reboot_control(self):
        p_bPartial = True
        if len(self.m_lSubMenus) == 1: p_bPartial = False
        # add submenu reboot control to the list
        try:
            p_bCheck = False
            p_lCtrl = self.m_lSubMenus[-1].m_lReboot
            for item in self.m_lReboot:
                if p_lCtrl[0] == item[0]:
                    item[1] = p_lCtrl[1]
                    p_bCheck = True
            # add to the list if not exist
            if not p_bCheck: 
                self.m_lReboot.append(self.m_lSubMenus[-1].m_lReboot)
        except:
            pass

        # show sys reboot icon if needed in current submenu
        # if any submenu requires sys reboot, icon will appear on main page
        p_bCheck = False
        if p_bPartial:
            try:
                name = self.m_lSubMenus[-1].m_lReboot[0]
                for item in self.m_lReboot:
                    if item[0] == name:
                        if item[1] == True: p_bCheck = True
            except:
                p_bCheck = False
        else:
            for item in self.m_lReboot:
                if item[1] == True: p_bCheck = True
        self.m_bReboot = p_bCheck 
开发者ID:krahsdevil,项目名称:Retropie-CRT-Edition,代码行数:34,代码来源:index.py

示例7: app

# 需要导入模块: import main [as 别名]
# 或者: from main import main [as 别名]
def app(mock_env, mock_http, mock_session):
    return main.DnsVmGcApp(http=mock_http, session=mock_session) 
开发者ID:GoogleCloudPlatform,项目名称:professional-services,代码行数:4,代码来源:main_test.py

示例8: app_debug

# 需要导入模块: import main [as 别名]
# 或者: from main import main [as 别名]
def app_debug(mock_env_debug, mock_http, mock_session):
    return main.DnsVmGcApp(http=mock_http, session=mock_session) 
开发者ID:GoogleCloudPlatform,项目名称:professional-services,代码行数:4,代码来源:main_test.py

示例9: app_warm

# 需要导入模块: import main [as 别名]
# 或者: from main import main [as 别名]
def app_warm(app, monkeypatch):
    """When the function is warmed up from previous events"""
    monkeypatch.setattr(main.RuntimeState, 'app', app)
    return app 
开发者ID:GoogleCloudPlatform,项目名称:professional-services,代码行数:6,代码来源:main_test.py

示例10: app_cold

# 需要导入模块: import main [as 别名]
# 或者: from main import main [as 别名]
def app_cold(monkeypatch, mock_env, mock_session, mock_http):
    """When the function executes from a cold start"""
    monkeypatch.setattr(main.RuntimeState, 'app', None)
    return None 
开发者ID:GoogleCloudPlatform,项目名称:professional-services,代码行数:6,代码来源:main_test.py

示例11: handler

# 需要导入模块: import main [as 别名]
# 或者: from main import main [as 别名]
def handler(app, trigger_event):
    return main.EventHandler(app=app, data=trigger_event) 
开发者ID:GoogleCloudPlatform,项目名称:professional-services,代码行数:4,代码来源:main_test.py

示例12: test_config_no_zones

# 需要导入模块: import main [as 别名]
# 或者: from main import main [as 别名]
def test_config_no_zones(mock_env_no_zones, app, trigger_event):
    with pytest.raises(EnvironmentError) as err:
        main.EventHandler(app=app, data=trigger_event)
    assert "Env var DNS_VM_GC_DNS_ZONES is required" in str(err.value) 
开发者ID:GoogleCloudPlatform,项目名称:professional-services,代码行数:6,代码来源:main_test.py

示例13: test_debug_env_log_level

# 需要导入模块: import main [as 别名]
# 或者: from main import main [as 别名]
def test_debug_env_log_level(mock_env_debug, mock_http):
    """Log level is DEBUG when DEBUG=1"""
    app = main.DnsVmGcApp(mock_http)
    assert app.log.level == logging.DEBUG 
开发者ID:GoogleCloudPlatform,项目名称:professional-services,代码行数:6,代码来源:main_test.py

示例14: test_when_warm

# 需要导入模块: import main [as 别名]
# 或者: from main import main [as 别名]
def test_when_warm(app_warm, mock_http, mock_session, trigger_event_done):
    assert main.RuntimeState.app is app_warm
    main.main(trigger_event_done, context=None, http=mock_http,
              session=mock_session)
    assert main.RuntimeState.app is app_warm 
开发者ID:GoogleCloudPlatform,项目名称:professional-services,代码行数:7,代码来源:main_test.py

示例15: test_when_cold

# 需要导入模块: import main [as 别名]
# 或者: from main import main [as 别名]
def test_when_cold(app_cold, mock_http, mock_session, trigger_event_done):
    assert main.RuntimeState.app is None
    main.main(trigger_event_done, context=None, http=mock_http,
              session=mock_session)
    assert main.RuntimeState.app is not None 
开发者ID:GoogleCloudPlatform,项目名称:professional-services,代码行数:7,代码来源:main_test.py


注:本文中的main.main方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。