Exemplo n.º 1
0
    def __init__(self, user_profile = None, *args):
        UmitConfigParser.__init__(self, *args)

        if not user_profile:
            user_profile = Path.scan_profile

        fconf = open(user_profile, 'r')
        self.readfp(fconf, user_profile)

        fconf.close()
        del(fconf)

        self.attributes = {}
Exemplo n.º 2
0
    def __init__(self, user_profile=None, *args):
        UmitConfigParser.__init__(self, *args)

        if not user_profile:
            user_profile = Path.scan_profile

        fconf = open(user_profile, 'r')
        self.readfp(fconf, user_profile)

        fconf.close()
        del (fconf)

        self.attributes = {}
Exemplo n.º 3
0
    def __init__(self, user_profile=None, *args):
        UmitConfigParser.__init__(self, *args)

        try:
            if not user_profile:
                user_profile = Path.scan_profile

            self.read(user_profile)
        except ConfigParser_Error as e:
            # No scan profiles found is not a reason to crash.
            self.add_profile(_("Profiles not found"),
                    command="nmap",
                    description=_("The {} file is missing or corrupted").format(user_profile))

        self.attributes = {}
Exemplo n.º 4
0
    def __init__(self, user_profile=None, *args):
        UmitConfigParser.__init__(self, *args)

        try:
            if not user_profile:
                user_profile = Path.scan_profile

            self.read(user_profile)
        except Exception as e:
            # No scan profiles found is not a reason to crash.
            self.add_profile("Profiles not found",
                    command="nmap",
                    description="The {} file was not found".format(user_profile))

        self.attributes = {}
Exemplo n.º 5
0
    def __init__(self, user_profile=None, *args):
        UmitConfigParser.__init__(self, *args)

        try:
            if not user_profile:
                user_profile = Path.scan_profile

            self.read(user_profile)
        except ConfigParser_Error as e:
            # No scan profiles found is not a reason to crash.
            self.add_profile(_("Profiles not found"),
                    command="nmap",
                    description=_("The {} file is missing or corrupted"
                        ).format(user_profile))

        self.attributes = {}
Exemplo n.º 6
0
import re

from types import StringTypes
from ConfigParser import DuplicateSectionError, NoSectionError, NoOptionError
from ConfigParser import Error as ConfigParser_Error

from zenmapCore.Paths import Path
from zenmapCore.UmitLogging import log
from zenmapCore.UmitConfigParser import UmitConfigParser
import zenmapCore.I18N  # lgtm[py/unused-import]

# This is the global configuration parser object that represents the contents
# of zenmap.conf. It should be initialized once by the application. Most
# interaction with the global parser is done by other classes in this file,
# like SearchConfig, that wrap specific configuration sections.
config_parser = UmitConfigParser()

# Check if running on Maemo
MAEMO = False
try:
    import hildon
    MAEMO = True
except ImportError:
    pass


def is_maemo():
    return MAEMO


class SearchConfig(UmitConfigParser, object):