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()
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!")
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()