示例#1
0
    def _parser_parse_args(self):
        """
        overwritten method of class Memacs

        all additional arguments are parsed in here
        """
        Memacs._parser_parse_args(self)

        if self._args.log:
            if not os.path.isfile(self._args.log):
                self._parser.error("logfile does not exist")

        if self._args.cfg:
            if not os.path.isfile(self._args.cfg):
                self._parser.error("config file does not exist")

        if self._args.csv:
            if not os.path.isfile(self._args.csv):
                self._parser.error("csv file does not exist")

        if self._args.csv and self._args.log or self._args.inactive:
            self._parser.error("You gave both \"--csv\" and \"--logfile\" or \"--also-inactive\" argument." + \
                               "Please use either or.")

        if not self._args.intervals:
            self._parser.error("No intervals tag or category specified")
示例#2
0
    def _parser_parse_args(self):
        """
        overwritten method of class Memacs

        all additional arguments are parsed in here
        """
        Memacs._parser_parse_args(self)
示例#3
0
    def _parser_parse_args(self):
        Memacs._parser_parse_args(self)

        if self._args.filenametimestamps_folder and self._args.filelist:
            self._parser.error(
                "You gave both \"--filelist\" and \"--folder\" argument. Please use either or.\n"
            )

        if self._args.omit_drawers and self._args.append:
            self._parser.error(
                "You gave both \"--append\" and \"--omit-drawers\" argument. Please use either or.\n"
            )

        if not self._args.filelist and not self._args.filenametimestamps_folder:
            self._parser.error("no filenametimestamps_folder specified")

        if self._args.filelist:
            if not os.path.isfile(self._args.filelist):
                self._parser.error("Check the filelist argument: " + "[" +
                                   str(self._args.filelist) +
                                   "] is not an existing file")

        if self._args.filenametimestamps_folder:
            for f in self._args.filenametimestamps_folder:
                if not os.path.isdir(f):
                    self._parser.error("Check the folderlist argument: " +
                                       "[" + str(f) +
                                       "] and probably more aren't folders")
示例#4
0
    def _parser_parse_args(self):
        """
        overwritten method of class Memacs

        all additional arguments are parsed in here
        """
        Memacs._parser_parse_args(self)
        if not os.path.exists(self._args.photo_folder):
            self._parser.error("photo folder does not exist")
示例#5
0
    def _parser_parse_args(self):
        """
        overwritten method of class Memacs

        all additional arguments are parsed in here
        """
        Memacs._parser_parse_args(self)
        if not (os.path.exists(self._args.smsxmlfile) or \
                     os.access(self._args.smsxmlfile, os.R_OK)):
            self._parser.error("input file not found or not readable")
示例#6
0
    def _parser_parse_args(self):
        """
        overwritten method of class Memacs

        all additional arguments are parsed in here
        """
        Memacs._parser_parse_args(self)

        if self._args.fieldnames:
            self._args.fieldnames = [name.strip() for name in self._args.fieldnames.split(',')]
示例#7
0
    def _parser_parse_args(self):
        """
        overwritten method of class Memacs

        all additional arguments are parsed in here
        """
        Memacs._parser_parse_args(self)

        if self._args.output_format:
            self._args.output_format = self._args.output_format
示例#8
0
    def _parser_parse_args(self):
        """
        overwritten method of class Memacs

        all additional arguments are parsed in here
        """
        Memacs._parser_parse_args(self)

        if not self._args.list_folders and not self._args.folder_name:
            self._parser.error("please specify a folder " + \
                                   "use --list to find a folder")
示例#9
0
    def _parser_parse_args(self):
        """
        overwritten method of class Memacs

        all additional arguments are parsed in here
        """
        Memacs._parser_parse_args(self)

        if not os.path.exists(self._args.source):
            self._parser.error("source file or folder does not exist")

        if self._args.url and not self._args.url.startswith("http"):
            self._parser.error("invalid url given")
示例#10
0
    def _parser_parse_args(self):
        Memacs._parser_parse_args(self)

        if not self._args.calendar_url and not self._args.calendar_file:
            self._parser.error("specify a calendar url or calendar file")

        if self._args.calendar_url and self._args.calendar_file:
            self._parser.error(
                "only set a url or path to a calendar not both.")

        if self._args.calendar_file  \
        and not os.path.exists(self._args.calendar_file):
            self._parser.error("calendar path not exists")
示例#11
0
    def _parser_parse_args(self):
        """
        overwritten method of class Memacs

        all additional arguments are parsed in here
        """
        Memacs._parser_parse_args(self)
        if self._args.gitrevfile and not \
                (os.path.exists(self._args.gitrevfile) or \
                     os.access(self._args.gitrevfile, os.R_OK)):
            self._parser.error("input file not found or not readable")

        if not self._args.encoding:
            self._args.encoding = "utf-8"
示例#12
0
    def _parser_parse_args(self):
        """
        overwritten method of class Memacs

        all additional arguments are parsed in here
        """
        Memacs._parser_parse_args(self)
        if self._args.orgcontactsfile:
            if not (os.path.exists(self._args.orgcontactsfile) or \
                    os.access(self._args.orgcontactsfile, os.R_OK)):
                self._parser.error(
                    "Org-contacts file not found or not readable")
            self._numberdict = parse_org_contact_file(
                self._args.orgcontactsfile)
        else:
            self._numberdict = {}
示例#13
0
    def _parser_parse_args(self):
        """
        overwritten method of class Memacs

        all additional arguments are parsed in here
        """
        Memacs._parser_parse_args(self)
        if self._args.url and self._args.file:
            self._parser.error("you cannot set both url and file")

        if not self._args.url and not self._args.file:
            self._parser.error("please specify a file or url")

        if self._args.file:
            if not os.path.exists(self._args.file):
                self._parser.error("file %s not readable", self._args.file)
            if not os.access(self._args.file, os.R_OK):
                self._parser.error("file %s not readable", self._args.file)
示例#14
0
    def _parser_parse_args(self):
        """
        overwritten method of class Memacs
        all additional arguments are parsed in here
        """
        Memacs._parser_parse_args(self)

        self._query = []

        if self._args.sender:
            self._args.sendern = self._args.sender.strip()
            self._sender = list(self._args.sender.split(" "))
        else:
            raise ValueError('You have to specify at least one e mail adress')

        if self._args.query:
            self._query = self._args.query

        if self._args.todo:
            self._todo = True
        else:
            self._todo = False