def show_info_dialog(self, feature): """ Some features show an information dialog when this screen is accepted """ if feature == "aur": # Aur disclaimer txt1 = _("Arch User Repository - Disclaimer") txt2 = _( "The Arch User Repository is a collection of user-submitted PKGBUILDs\n" "that supplement software available from the official repositories.\n\n" "The AUR is community driven and NOT supported by Arch or Antergos.\n" ) elif feature == "ufw": # Ufw rules info txt1 = _( "Uncomplicated Firewall will be installed with these rules:") toallow = misc.get_network() txt2 = _( "ufw default deny\nufw allow from {0}\nufw allow Transmission\n" "ufw allow SSH").format(toallow) else: # No message return txt1 = "<big>{0}</big>".format(txt1) txt2 = "<i>{0}</i>".format(txt2) info = Gtk.MessageDialog(transient_for=self.get_main_window(), modal=True, destroy_with_parent=True, message_type=Gtk.MessageType.INFO, buttons=Gtk.ButtonsType.CLOSE) info.set_markup(txt1) info.format_secondary_markup(txt2) info.run() info.destroy()
def show_info_dialog(self, feature): """ Some features show an information dialog when this screen is accepted """ if feature == "aur": # Aur disclaimer txt1 = _("Arch User Repository - Disclaimer") txt2 = _("The Arch User Repository is a collection of user-submitted PKGBUILDs\n" "that supplement software available from the official repositories.\n\n" "The AUR is community driven and NOT supported by Arch or Antergos.\n") elif feature == "ufw": # Ufw rules info txt1 = _("Uncomplicated Firewall will be installed with these rules:") toallow = misc.get_network() txt2 = _("ufw default deny\nufw allow from {0}\nufw allow Transmission\n" "ufw allow SSH").format(toallow) else: # No message return txt1 = "<big>{0}</big>".format(txt1) txt2 = "<i>{0}</i>".format(txt2) info = Gtk.MessageDialog( transient_for=self.get_main_window(), modal=True, destroy_with_parent=True, message_type=Gtk.MessageType.INFO, buttons=Gtk.ButtonsType.CLOSE) info.set_markup(txt1) info.format_secondary_markup(txt2) info.run() info.destroy()
def setup_features(self): """ Do all set up needed by the user's selected features """ services = [] if self.settings.get("feature_bluetooth"): services.append("bluetooth") if self.settings.get("feature_cups"): services.append("org.cups.cupsd") services.append("avahi-daemon") if self.settings.get("feature_smb"): services.append("smbd") if self.settings.get("feature_firewall"): logging.debug("Configuring firewall...") # Set firewall rules firewall.run(["default", "deny"]) toallow = misc.get_network() if toallow: firewall.run(["allow", "from", toallow]) firewall.run(["allow", "Transmission"]) firewall.run(["allow", "SSH"]) firewall.run(["enable"]) services.append("ufw") if self.settings.get("feature_lamp") and not self.settings.get("feature_lemp"): try: from installation import lamp logging.debug("Configuring LAMP...") lamp.setup() services.extend(["httpd", "mysqld"]) except ImportError as import_error: logging.warning("Unable to import LAMP module: %s", str(import_error)) elif self.settings.get("feature_lemp"): try: from installation import lemp logging.debug("Configuring LEMP...") lemp.setup() services.extend(["nginx", "mysqld", "php-fpm"]) except ImportError as import_error: logging.warning("Unable to import LEMP module: %s", str(import_error)) self.enable_services(services)