示例#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_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)
示例#3
0
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument("-q",
                                  "--query",
                                  dest="query",
                                  help="mu search query")

        self._parser.add_argument(
            "-m",
            "--me",
            dest="sender",
            help="space seperated list of mail addresses that belongs to you")

        self._parser.add_argument(
            "-d",
            "--delegation",
            dest="todo",
            action='store_true',
            help="adds NEXT or WAITING state to flagged messages")
示例#4
0
    def _parser_parse_args(self):
        """
        overwritten method of class Memacs

        all additional arguments are parsed in here
        """
        Memacs._parser_parse_args(self)
示例#5
0
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
           "-f", "--file", dest="gitrevfile",
           action="store",
           help="path to a an file which contains output from " + \
           " following git command: git rev-list --all --pretty=raw")

        self._parser.add_argument(
           "-g", "--grep-user", dest="grepuser",
           action="store",
           help="if you wanna parse only commit from a specific person. " + \
           "format:<Forname Lastname> of user to grep")

        self._parser.add_argument(
           "-e", "--encoding", dest="encoding",
           action="store",
           help="default encoding utf-8, see " + \
           "http://docs.python.org/library/codecs.html#standard-encodings" + \
           "for possible encodings")
示例#6
0
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument("-f",
                                  "--folder",
                                  dest="source",
                                  action="store",
                                  required=True,
                                  help="path to gpx file or folder")

        self._parser.add_argument("-p",
                                  "--provider",
                                  dest="provider",
                                  action="store",
                                  default="google",
                                  help="geocode provider, default google")

        self._parser.add_argument("-u",
                                  "--url",
                                  dest="url",
                                  action="store",
                                  help="url to nominatim server (osm only)")

        self._parser.add_argument("--output-format",
                                  dest="output_format",
                                  action="store",
                                  default="{address}",
                                  help="format string to use for the headline")
示例#7
0
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
            "-f",
            "--file",
            dest="historystore",
            action="store",
            type=file,
            required=True,
            help="""path to places.sqlite file. usually in
/home/rgrau/.mozilla/firefox/__SOMETHING__.default/places.sqlite """)

        self._parser.add_argument("--output-format",
                                  dest="output_format",
                                  action="store",
                                  default="[[{url}][{title}]]",
                                  help="format string to use for the headline")

        self._parser.add_argument(
            "--omit-drawer",
            dest="omit_drawer",
            action="store_true",
            required=False,
            help=
            """Use a minimal output format that omits the PROPERTIES drawer."""
        )
示例#8
0
文件: sms.py 项目: easeflyer/Memacs
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
            "-f", "--file", dest="smsxmlfile",
            action="store", required=True,
            help="path to sms xml backup file")

        self._parser.add_argument(
            "--ignore-incoming", dest="ignore_incoming",
            action="store_true",
            help="ignore incoming smses")

        self._parser.add_argument(
            "--ignore-outgoing", dest="ignore_outgoing",
            action="store_true",
            help="ignore outgoing smses")

        self._parser.add_argument(
            "--orgcontactsfile", dest="orgcontactsfile",
            action="store", required=False,
            help="path to Org-contacts file for phone number lookup. Phone numbers have to match.")
示例#9
0
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
            "-f", "--file", dest="smsxmlfile",
            action="store", required=True,
            help="path to sms xml backup file")

        self._parser.add_argument(
            "--ignore-incoming", dest="ignore_incoming",
            action="store_true",
            help="ignore incoming phonecalls")

        self._parser.add_argument(
            "--ignore-outgoing", dest="ignore_outgoing",
            action="store_true",
            help="ignore outgoing phonecalls")

        self._parser.add_argument(
            "--ignore-missed", dest="ignore_missed",
            action="store_true",
            help="ignore outgoing phonecalls")

        self._parser.add_argument(
            "--minimum-duration", dest="minimum_duration",
            action="store", type=int,
            help="[sec] show only calls with duration >= this argument")
示例#10
0
文件: git.py 项目: njagadeesh/Memacs
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
            "-f",
            "--file",
            dest="gitrevfile",
            action="store",
            help="path to a an file which contains output from "
            + " following git command: git rev-list --all --pretty=raw",
        )

        self._parser.add_argument(
            "-g",
            "--grep-user",
            dest="grepuser",
            action="store",
            help="if you wanna parse only commit from a specific person. "
            + "format:<Forname Lastname> of user to grep",
        )

        self._parser.add_argument(
            "-e",
            "--encoding",
            dest="encoding",
            action="store",
            help="default encoding utf-8, see "
            + "http://docs.python.org/library/codecs.html#standard-encodings"
            + "for possible encodings",
        )
示例#11
0
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
           "-u", "--url", dest="url",
           action="store",
           help="url to xml file")

        self._parser.add_argument(
           "-f", "--file", dest="file",
           action="store",
           help="path to xml file")

        self._parser.add_argument(
           "-i", "--ini", dest="ini",
           action="store",
           help="path to xml config file")

        self._parser.add_argument(
           "-co", "--section", dest="section",
           action="store",
           help="section of config file")

        self._parser.add_argument(
           "-de", "--delimiter", dest="splitcriterion",
           action="store",
           help="you can set this to specify a " +
                "splitting-criterion for tags(" " is default")
示例#12
0
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)
示例#13
0
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
           "-l", "--list-folders",
           dest="list_folders",
           action="store_true",
           help="show possible folders of connection")

        self._parser.add_argument(
           "-f", "--folder_name",
           dest="folder_name",
           help="name of folder to get emails from, " + \
            "when you don't know name call --list-folders")

        self._parser.add_argument(
           "--fetch-number",
           dest="fetch_number",
           help="how many -last- mails should we fetch from the server?",
           type=int)
示例#14
0
    def _parser_add_arguments(self):
        Memacs._parser_add_arguments(self)

        self._parser.add_argument("-f", "--folder",
                                  dest="filenametimestamps_folder",
                                  action="append",
                                  help="path to a folder to search for " + \
                                      "filenametimestamps, " + \
                                  "multiple folders can be specified: " + \
                                      "-f /path1 -f /path2")

        self._parser.add_argument("-x", "--exclude", dest="exclude_folder",
                        help="path to excluding folder, for more excludes " + \
                             "use this: -x /path/exclude -x /path/exclude")

        self._parser.add_argument("--filelist", dest="filelist",
                        help="file containing a list of files to process. " + \
                             "either use \"--folder\" or the \"--filelist\" argument, not both.")

        self._parser.add_argument("--ignore-non-existing-items",
                                  dest="ignore_nonexisting", action="store_true",
                                  help="ignores non-existing files or folders within filelist")

        self._parser.add_argument("-l", "--follow-links",
                                  dest="follow_links", action="store_true",
                                  help="follow symbolics links," + \
                                      " default False")

        self._parser.add_argument("--skip-file-time-extraction",
                                  dest="skip_filetime_extraction",
                                  action="store_true",
                                  help="skip extraction of the file time " + \
                                  " in files containing only the date in " + \
                                  "the filename"
        )
示例#15
0
文件: phonecalls.py 项目: ajft/Memacs
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
            "-f", "--file", dest="smsxmlfile",
            action="store", required=True,
            help="path to sms xml backup file")

        self._parser.add_argument(
            "--ignore-incoming", dest="ignore_incoming",
            action="store_true",
            help="ignore incoming phonecalls")

        self._parser.add_argument(
            "--ignore-outgoing", dest="ignore_outgoing",
            action="store_true",
            help="ignore outgoing phonecalls")

        self._parser.add_argument(
            "--ignore-missed", dest="ignore_missed",
            action="store_true",
            help="ignore outgoing phonecalls")

        self._parser.add_argument(
            "--minimum-duration", dest="minimum_duration",
            action="store", type=int,
            help="[sec] show only calls with duration >= this argument")
示例#16
0
    def _parser_add_arguments(self):
        Memacs._parser_add_arguments(self)

        self._parser.add_argument("-f", "--folder",
                                  dest="filenametimestamps_folder",
                                  action="append",
                                  help="path to a folder to search for " + \
                                      "filenametimestamps, " + \
                                  "multiple folders can be specified: " + \
                                      "-f /path1 -f /path2")

        self._parser.add_argument("-x", "--exclude", dest="exclude_folder",
                        help="path to excluding folder, for more excludes " + \
                             "use this: -x /path/exclude -x /path/exclude")

        self._parser.add_argument("-l", "--follow-links",
                                  dest="follow_links", action="store_true",
                                  help="follow symbolics links," + \
                                      " default False")

        self._parser.add_argument("--skip-file-time-extraction",
                                  dest="skip_filetime_extraction",
                                  action="store_true",
                                  help="skip extraction of the file time " + \
                                  " in files containing only the date in " + \
                                  "the filename"
        )
示例#17
0
文件: sms.py 项目: serycjon/Memacs
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
            "-f", "--file", dest="smsxmlfile",
            action="store", required=True,
            help="path to sms xml backup file")

        self._parser.add_argument(
            "--ignore-incoming", dest="ignore_incoming",
            action="store_true",
            help="ignore incoming smses")

        self._parser.add_argument(
            "--ignore-outgoing", dest="ignore_outgoing",
            action="store_true",
            help="ignore outgoing smses")

        self._parser.add_argument(
            "--orgcontactsfile", dest="orgcontactsfile",
            action="store", required=False,
            help="path to Org-contacts file for phone number lookup. Phone numbers have to match.")
示例#18
0
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
            "-f",
            "--file",
            dest="historystore",
            action="store",
            type=file,
            required=True,
            help="""path to Google Chrome History sqlite file. usually in
/home/bala/.config/google-chrome/Default/History """)

        self._parser.add_argument("--output-format",
                                  dest="output_format",
                                  action="store",
                                  default="[[{url}][{title}]]",
                                  help="format string to use for the headline")

        self._parser.add_argument(
            "--omit-drawer",
            dest="omit_drawer",
            action="store_true",
            required=False,
            help=
            """Use a minimal output format that omits the PROPERTIES drawer."""
        )
示例#19
0
文件: battery.py 项目: jagg-ix/Memacs
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument("-b",
                                  "--battery",
                                  dest="name",
                                  action="store",
                                  default="BAT0",
                                  help="select battery to read stats from")

        self._parser.add_argument("-p",
                                  "--path",
                                  dest="path",
                                  action="store",
                                  default=ROOT,
                                  help=argparse.SUPPRESS)

        self._parser.add_argument("--output-format",
                                  dest="output_format",
                                  action="store",
                                  default="{battery.name}",
                                  help="format string to use for the output")
示例#20
0
    def _parser_add_arguments(self):
        Memacs._parser_add_arguments(self)

        self._parser.add_argument("-f", "--folder",
                                  dest="filenametimestamps_folder",
                                  action="append",
                                  help="path to a folder to search for " + \
                                      "filenametimestamps, " + \
                                  "multiple folders can be specified: " + \
                                      "-f /path1 -f /path2")

        self._parser.add_argument("-x", "--exclude", dest="exclude_folder",
                        help="path to excluding folder, for more excludes " + \
                             "use this: -x /path/exclude -x /path/exclude")

        self._parser.add_argument("-l", "--follow-links",
                                  dest="follow_links", action="store_true",
                                  help="follow symbolics links," + \
                                      " default False")

        self._parser.add_argument("--skip-file-time-extraction",
                                  dest="skip_filetime_extraction",
                                  action="store_true",
                                  help="skip extraction of the file time " + \
                                  " in files containing only the date in " + \
                                  "the filename"
        )
示例#21
0
文件: battery.py 项目: jagg-ix/Memacs
    def _parser_parse_args(self):
        """
        overwritten method of class Memacs

        all additional arguments are parsed in here
        """
        Memacs._parser_parse_args(self)
示例#22
0
    def _parser_parse_args(self):
        Memacs._parser_parse_args(self)
        if not self._args.filenametimestamps_folder:
            self._parser.error("no filenametimestamps_folder specified")

        for f in self._args.filenametimestamps_folder:
            if not os.path.isdir(f):
                self._parser.error("Check the folderlist - " + \
                                       "one or more aren't folders")
示例#23
0
文件: photos.py 项目: serycjon/Memacs
    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")
示例#24
0
    def _parser_parse_args(self):
        Memacs._parser_parse_args(self)
        if not self._args.filenametimestamps_folder:
            self._parser.error("no filenametimestamps_folder specified")

        for f in self._args.filenametimestamps_folder:
            if not os.path.isdir(f):
                self._parser.error("Check the folderlist - " + \
                                       "one or more aren't folders")
示例#25
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")
示例#26
0
文件: lastfm.py 项目: serycjon/Memacs
    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.decode('utf-8')
示例#27
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")
示例#28
0
文件: phonecalls.py 项目: ajft/Memacs
    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")
示例#29
0
文件: imap.py 项目: Daniel1234/Memacs
    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")
示例#30
0
文件: imap.py 项目: stvol/Memacs
    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")
示例#31
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(',')
            ]
示例#32
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.folder_path:
                self._parser.error("please specify the path to Maildir folder")
        if not (os.path.exists(self._args.folder_path) or \
            os.access(self._args.folder_path, os.R_OK)):
            self._parser.error("folder path not found")
示例#33
0
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
            "-f", "--file", dest="phonelogfile",
            action="store", required=True,
            help="path to phone log file")
示例#34
0
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
            "-f", "--file", dest="phonelogfile",
            action="store", required=True,
            help="path to phone log file")
示例#35
0
文件: ical.py 项目: M1lan/Memacs
    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")
示例#36
0
文件: lastfm.py 项目: serycjon/Memacs
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument('--output-format',
                                  dest='output_format',
                                  action='store',
                                  default=u'{title}',
                                  help='formt string to use for the output')
示例#37
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")
示例#38
0
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
           "-fp", "--folder_path",
           dest="folder_path",
           help="path to the Maildir folder"
                "path/to/Maildirfolder")
示例#39
0
文件: ical.py 项目: stvol/Memacs
    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")
示例#40
0
文件: git.py 项目: njagadeesh/Memacs
    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"
示例#41
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"
示例#42
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.store_file:
            self._parser.error("please specify the path to "
                               "store.tgs")
        if not (os.path.exists(self._args.store_file) or \
            os.access(self._args.store_file, os.R_OK)):
            self._parser.error("path not found")
        '''if not self._args.store_path:
示例#43
0
文件: csv.py 项目: stvol/Memacs
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument("-f",
                                  "--file",
                                  dest="csvfile",
                                  action="store",
                                  help="input csv file")

        self._parser.add_argument("-d",
                                  "--delimiter",
                                  dest="delimiter",
                                  action="store",
                                  help="delimiter, default \";\"")

        self._parser.add_argument(
           "-e", "--encoding", dest="encoding",
           action="store",
           help="default encoding utf-8, see " + \
           "http://docs.python.org/library/codecs.html#standard-encodings" + \
           "for possible encodings")

        self._parser.add_argument("-ti",
                                  "--timestamp-index",
                                  dest="timestamp_index",
                                  action="store",
                                  help="on which column is timestamp?")

        self._parser.add_argument(
           "-tf", "--timestamp-format", dest="timestamp_format",
           action="store",
           #help="format of the timestamp, i.e. \"%d.%m.%Y %H:%M:%S:%f\" " + \
           help="format of the timestamp, i.e. " + \
           "\"%%d.%%m.%%Y %%H:%%M:%%S:%%f\" " + \
           "for  \"14.02.2012 10:22:37:958\" see " + \
           "http://docs.python.org/library/time.html#time.strftime" + \
           "for possible formats")

        self._parser.add_argument(
            "-oi",
            "--output-indices",
            dest="output_indices",
            action="store",
            help="indices to use for output i.e. \"1 2 3\"")
示例#44
0
文件: sms.py 项目: serycjon/Memacs
    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")

        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 = self.parse_org_contact_file(self._args.orgcontactsfile)
示例#45
0
文件: sms.py 项目: easeflyer/Memacs
    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")

        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 = self.parse_org_contact_file(self._args.orgcontactsfile)
示例#46
0
文件: mbox.py 项目: Daniel1234/Memacs
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)
        self._parser.add_argument(
           "-mf", "--mbox-mail-file", dest="mail_file",
           action="store",
           help="path to maildir file")

        self._parser.add_argument(
           "-nf", "--mbox-news-file", dest="news_file",
           action="store",
           help="path to mbox newsgroup file")
示例#47
0
文件: photos.py 项目: serycjon/Memacs
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
            "-f", "--folder", dest="photo_folder",
            action="store", required=True,
            help="path to search for photos")

        self._parser.add_argument("-l", "--follow-links",
                                  dest="follow_links", action="store_true",
                                  help="follow symbolics links," + \
                                      " default False")
示例#48
0
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
            "-f", "--folder", dest="photo_folder",
            action="store", required=True,
            help="path to search for photos")

        self._parser.add_argument("-l", "--follow-links",
                                  dest="follow_links", action="store_true",
                                  help="follow symbolics links," + \
                                      " default False")
示例#49
0
文件: rss.py 项目: serycjon/Memacs
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
           "-u", "--url", dest="url",
           action="store",
           help="url to a rss file")

        self._parser.add_argument(
           "-f", "--file", dest="file",
           action="store",
           help="path to rss file")
示例#50
0
文件: rss.py 项目: Daniel1234/Memacs
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
           "-u", "--url", dest="url",
           action="store",
           help="url to a rss file")

        self._parser.add_argument(
           "-f", "--file", dest="file",
           action="store",
           help="path to rss file")
示例#51
0
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
           "-f", "--store_file",
           dest="store_file",
           help="path to store.tgs file"
                " path/to/store.tgs")
        self._parser.add_argument(
           "-sp", "--store_path",
           dest="store_path",
           help="path to storage main folder"
                " path/to/mainfolder")
示例#52
0
文件: rss.py 项目: serycjon/Memacs
    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)
示例#53
0
文件: rss.py 项目: Daniel1234/Memacs
    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)
示例#54
0
文件: csv.py 项目: Daniel1234/Memacs
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
           "-f", "--file", dest="csvfile",
           action="store",
           help="input csv file")

        self._parser.add_argument(
           "-d", "--delimiter", dest="delimiter",
           action="store",
           help="delimiter, default \";\"")

        self._parser.add_argument(
           "-e", "--encoding", dest="encoding",
           action="store",
           help="default encoding utf-8, see " + \
           "http://docs.python.org/library/codecs.html#standard-encodings" + \
           "for possible encodings")

        self._parser.add_argument(
           "-ti", "--timestamp-index", dest="timestamp_index",
           action="store",
           help="on which column is timestamp?")

        self._parser.add_argument(
           "-tf", "--timestamp-format", dest="timestamp_format",
           action="store",
           #help="format of the timestamp, i.e. \"%d.%m.%Y %H:%M:%S:%f\" " + \
           help="format of the timestamp, i.e. " + \
           "\"%%d.%%m.%%Y %%H:%%M:%%S:%%f\" " + \
           "for  \"14.02.2012 10:22:37:958\" see " + \
           "http://docs.python.org/library/time.html#time.strftime" + \
           "for possible formats")

        self._parser.add_argument(
           "-oi", "--output-indices", dest="output_indices",
           action="store",
           help="indices to use for output i.e. \"1 2 3\"")
示例#55
0
    def _parser_add_arguments(self):
        Memacs._parser_add_arguments(self)

        self._parser.add_argument("-f", "--folder",
                                  dest="filenametimestamps_folder",
                                  action="append",
                                  help="path to a folder to search for " + \
                                       "filenametimestamps, " + \
                                       "multiple folders can be specified: " + \
                                       "-f /path1 -f /path2")

        self._parser.add_argument("-x", "--exclude", dest="exclude_folder",
                        help="path to excluding folder, for more excludes " + \
                             "use this: -x /path/exclude -x /path/exclude")

        self._parser.add_argument("--filelist", dest="filelist",
                        help="file containing a list of files to process. " + \
                             "either use \"--folder\" or the \"--filelist\" argument, not both.")

        self._parser.add_argument(
            "--ignore-non-existing-items",
            dest="ignore_nonexisting",
            action="store_true",
            help="ignores non-existing files or folders within filelist")

        self._parser.add_argument("-l", "--follow-links",
                                  dest="follow_links", action="store_true",
                                  help="follow symbolics links," + \
                                      " default False")

        self._parser.add_argument("--skip-file-time-extraction",
                                  dest="skip_filetime_extraction",
                                  action="store_true",
                                  help="skip extraction of the file time " + \
                                  " in files containing only the date in " + \
                                  "the filename")

        self._parser.add_argument("--force-file-date-extraction",
                                  dest="force_filedate_extraction",
                                  action="store_true",
                                  help="force extraction of the file date" + \
                                  " even if there is no ISO datestamp in " + \
                                  "the filename"
        )
示例#56
0
文件: svn.py 项目: Daniel1234/Memacs
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
            "-f", "--file", dest="svnlogxmlfile",
            action="store",
            help="path to a an file which contains output from " + \
                " following svn command: svn log --xml")

        self._parser.add_argument(
           "-g", "--grep-author", dest="grepauthor",
           action="store",
           help="if you wanna parse only messages from a specific person. " + \
           "format:<author> of author to grep")
示例#57
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 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")
示例#58
0
文件: imap.py 项目: Daniel1234/Memacs
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument(
           "-l", "--list-folders",
           dest="list_folders",
           action="store_true",
           help="show possible folders of connection")

        self._parser.add_argument(
           "-f", "--folder_name",
           dest="folder_name",
           help="name of folder to get emails from, " + \
            "when you don't know name call --list-folders")
示例#59
0
文件: imap.py 项目: stvol/Memacs
    def _parser_add_arguments(self):
        """
        overwritten method of class Memacs

        add additional arguments
        """
        Memacs._parser_add_arguments(self)

        self._parser.add_argument("-l",
                                  "--list-folders",
                                  dest="list_folders",
                                  action="store_true",
                                  help="show possible folders of connection")

        self._parser.add_argument(
           "-f", "--folder_name",
           dest="folder_name",
           help="name of folder to get emails from, " + \
            "when you don't know name call --list-folders")
示例#60
0
文件: mbox.py 项目: Daniel1234/Memacs
    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.mail_file and not self._args.news_file:
            self._parser.error("please specify a file")
        if self._args.mail_file and self._args.news_file:
            self._parser.error("please specify an mbox mail file "
                               "OR an mbox newsgroup file - not both")
        if self._args.mail_file and not (os.path.exists
                                        (self._args.mail_file) or \
            os.access(self._args.mail_file, os.R_OK)):
            self._parser.error("input file not found or not readable")
        if self._args.news_file and not (os.path.exists
                                        (self._args.news_file) or \
            os.access(self._args.news_file, os.R_OK)):
            self._parser.error("input file not found or not readable")