示例#1
0
    def check_writable(self):
        """
        Check if current session is ran with root privileges.

        .. note:: IF current session does not has the write privileges to the
            hosts file of current system, a warning message box would popup.

        .. note:: ALL operation would change the `hosts` file on current
            system could only be done while current session has write
            privileges to the file.
        """
        writable = CommonUtil.check_privileges()[1]
        self._writable = writable
        if not writable:
            self.warning_permission()
示例#2
0
    def check_writable(self):
        """
        Check if current session is ran with root privileges.

        .. note:: IF current session does not has the write privileges to the
            hosts file of current system, a warning message box would popup.

        .. note:: ALL operation would change the `hosts` file on current
            system could only be done while current session has write
            privileges to the file.
        """
        writable = CommonUtil.check_privileges()[1]
        self._writable = writable
        if not writable:
            self.warning_permission()
示例#3
0
    def check_writable(self):
        """
        Check if current session has write privileges to the hosts file.

        .. note:: IF current session does not has the write privileges to the
            hosts file of current system, a warning message box would popup.

        .. note:: ALL operation would change the `hosts` file on current
            system could only be done while current session has write
            privileges to the file.
        """
        self._writable = CommonUtil.check_privileges()[1]
        if not self._writable:
            print("Please check if you have writing\n"
                            "privileges to the hosts file!")
示例#4
0
    def check_writable(self):
        """
        Check if current session has write privileges to the hosts file.

        .. note:: IF current session does not has the write privileges to the
            hosts file of current system, a warning message box would popup.

        .. note:: ALL operation would change the `hosts` file on current
            system could only be done while current session has write
            privileges to the file.
        """
        self._writable = CommonUtil.check_privileges()[1]
        if not self._writable:
            self.messagebox(
                "Please check if you have writing\n"
                "privileges to the hosts file!", 1)
            exit()