imh

Check-in [e590b3c97b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fail more gracefully on message fetch failure
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:e590b3c97bff3de4dc112e55821ee4987582e885a22fbb7b40b79c642558a40d
User & Date: ajv-899-334-8894@vsta.org 2016-12-04 22:29:32
Context
2016-12-04
22:37
Support "last" (and "first") so we can do "show 7-last" check-in: b3c9234fa2 user: ajv-899-334-8894@vsta.org tags: master, trunk
22:29
Fail more gracefully on message fetch failure check-in: e590b3c97b user: ajv-899-334-8894@vsta.org tags: master, trunk
2016-11-26
22:57
Duh. check-in: cd527df803 user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to scan.py.

34
35
36
37
38
39
40

41
42


43
44

45
46
47
48
49
50
51
        fn = self.state["curbox"]
        curmsg = self.state["curmsgs"].get(fn)
        for m in msgs:
            # Flag current message, if any
            curstr = "+" if (m == curmsg) else " "

            # Get dope on this message number

            tup = srv.fetch(m,
             '(FLAGS BODY[HEADER.FIELDS (FROM TO DATE STATUS SUBJECT)])')


            if tup[0] != 'OK':
                sys.stderr.write("Can't fetch message %d\n" % (m,))

                break
            flags = self.flags_set(tup[1][0][0])
            fields = self.field_dict(tup[1][0][1])

            # Date of message
            if "Date" in fields:
                tm = self.dt_parse(fields["Date"])







>
|
|
>
>

|
>







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
        fn = self.state["curbox"]
        curmsg = self.state["curmsgs"].get(fn)
        for m in msgs:
            # Flag current message, if any
            curstr = "+" if (m == curmsg) else " "

            # Get dope on this message number
            try:
                tup = srv.fetch(m,
                 '(FLAGS BODY[HEADER.FIELDS (FROM TO DATE STATUS SUBJECT)])')
            except:
                tup = ("Fail", "Interrupted")
            if tup[0] != 'OK':
                sys.stderr.write("Can't fetch message %d: %s\n" %
                    (m, tup[1]))
                break
            flags = self.flags_set(tup[1][0][0])
            fields = self.field_dict(tup[1][0][1])

            # Date of message
            if "Date" in fields:
                tm = self.dt_parse(fields["Date"])