cosmetic: Switch to consistent four-spaces indent; run autopep8

We had a mixture of tab and 4space based indenting, which is a bad
idea.  4space is the standard in python, so convert all our code to
that.  The result unfortuantely still shoed even more inconsistencies,
so I've decided to run autopep8 on the entire code base.

Change-Id: I4a4b1b444a2f43fab05fc5d2c8a7dd6ddecb5f07
diff --git a/pySim/cat.py b/pySim/cat.py
index b8756e2..332ad58 100644
--- a/pySim/cat.py
+++ b/pySim/cat.py
@@ -24,34 +24,48 @@
 # Tag values as per TS 101 220 Table 7.23
 
 # TS 102 223 Section 8.1
+
+
 class Address(COMPR_TLV_IE, tag=0x06):
     _construct = Struct('ton_npi'/Int8ub,
                         'call_number'/BcdAdapter(Bytes(this._.total_len-1)))
 
 # TS 102 223 Section 8.2
+
+
 class AlphaIdentifier(COMPR_TLV_IE, tag=0x05):
     # FIXME: like EF.ADN
     pass
 
 # TS 102 223 Section 8.3
+
+
 class Subaddress(COMPR_TLV_IE, tag=0x08):
     pass
 
 # TS 102 223 Section 8.4
+
+
 class CapabilityConfigParams(COMPR_TLV_IE, tag=0x07):
     pass
 
 # TS 31.111 Section 8.5
+
+
 class CBSPage(COMPR_TLV_IE, tag=0x0C):
     pass
 
 # TS 102 223 Section 8.6
+
+
 class CommandDetails(COMPR_TLV_IE, tag=0x01):
     _construct = Struct('command_number'/Int8ub,
                         'type_of_command'/Int8ub,
                         'command_qualifier'/Int8ub)
 
 # TS 102 223 Section 8.7
+
+
 class DeviceIdentities(COMPR_TLV_IE, tag=0x82):
     DEV_IDS = bidict({
         0x01: 'keypad',
@@ -90,8 +104,9 @@
         0x81: 'uicc',
         0x82: 'terminal',
         0x83: 'network',
-        })
-    def _from_bytes(self, do:bytes):
+    })
+
+    def _from_bytes(self, do: bytes):
         return {'source_dev_id': self.DEV_IDS[do[0]], 'dest_dev_id': self.DEV_IDS[do[1]]}
 
     def _to_bytes(self):
@@ -100,200 +115,219 @@
         return bytes([src, dst])
 
 # TS 102 223 Section 8.8
+
+
 class Duration(COMPR_TLV_IE, tag=0x04):
     _construct = Struct('time_unit'/Int8ub,
                         'time_interval'/Int8ub)
 
 # TS 102 223 Section 8.9
+
+
 class Item(COMPR_TLV_IE, tag=0x0f):
     _construct = Struct('identifier'/Int8ub,
                         'text_string'/GsmStringAdapter(GreedyBytes))
 
 # TS 102 223 Section 8.10
+
+
 class ItemIdentifier(COMPR_TLV_IE, tag=0x10):
     _construct = Struct('identifier'/Int8ub)
 
 # TS 102 223 Section 8.11
+
+
 class ResponseLength(COMPR_TLV_IE, tag=0x11):
     _construct = Struct('minimum_length'/Int8ub,
                         'maximum_length'/Int8ub)
 
 # TS 102 223 Section 8.12
+
+
 class Result(COMPR_TLV_IE, tag=0x03):
     _construct = Struct('general_result'/Int8ub,
                         'additional_information'/HexAdapter(GreedyBytes))
 
 
-
 # TS 102 223 Section 8.13  + TS 31.111 Section 8.13
 class SMS_TPDU(COMPR_TLV_IE, tag=0x8B):
     _construct = Struct('tpdu'/HexAdapter(GreedyBytes))
 
 # TS 102 223 Section 8.15
+
+
 class TextString(COMPR_TLV_IE, tag=0x0d):
     _construct = Struct('dcs'/Int8ub,
                         'text_string'/HexAdapter(GreedyBytes))
 
 # TS 102 223 Section 8.16
+
+
 class Tone(COMPR_TLV_IE, tag=0x0e):
     _construct = Struct('tone'/Int8ub)
 
 # TS 31 111 Section 8.17
+
+
 class USSDString(COMPR_TLV_IE, tag=0x0a):
     _construct = Struct('dcs'/Int8ub,
                         'ussd_string'/HexAdapter(GreedyBytes))
 
 
-
 # TS 101 220 Table 7.17
 class ProactiveCommand(BER_TLV_IE, tag=0xD0):
     pass
 
 # TS 101 220 Table 7.17 + 31.111 7.1.1.2
+
+
 class SMSPPDownload(BER_TLV_IE, tag=0xD1,
                     nested=[DeviceIdentities, Address, SMS_TPDU]):
     pass
 
 # TS 101 220 Table 7.17 + 31.111 7.1.1.3
+
+
 class SMSCBDownload(BER_TLV_IE, tag=0xD2,
                     nested=[DeviceIdentities, CBSPage]):
     pass
 
+
 class USSDDownload(BER_TLV_IE, tag=0xD9,
-                    nested=[DeviceIdentities, USSDString]):
+                   nested=[DeviceIdentities, USSDString]):
     pass
 
 
 # reasonable default for playing with OTA
 # 010203040506070809101112131415161718192021222324252627282930313233
-#'7fe1e10e000000000000001f43000000ff00000000000000000000000000000000'
+# '7fe1e10e000000000000001f43000000ff00000000000000000000000000000000'
 
 # TS 102 223 Section 5.2
 term_prof_bits = {
-     # first byte
-      1: 'Profile download',
-      2: 'SMS-PP data download',
-      3: 'Cell Broadcast data download',
-      4: 'Menu selection',
-      5: 'SMS-PP data download',
-      6: 'Timer expiration',
-      7: 'USSD string DO support in CC by USIM',
-      8: 'Call Control by NAA',
+    # first byte
+    1: 'Profile download',
+    2: 'SMS-PP data download',
+    3: 'Cell Broadcast data download',
+    4: 'Menu selection',
+    5: 'SMS-PP data download',
+    6: 'Timer expiration',
+    7: 'USSD string DO support in CC by USIM',
+    8: 'Call Control by NAA',
 
-     # first byte
-      9: 'Command result',
-     10: 'Call Control by NAA',
-     11: 'Call Control by NAA',
-     12: 'MO short message control support',
-     13: 'Call Control by NAA',
-     14: 'UCS2 Entry supported',
-     15: 'UCS2 Display supported',
-     16: 'Display Text',
+    # first byte
+    9: 'Command result',
+    10: 'Call Control by NAA',
+    11: 'Call Control by NAA',
+    12: 'MO short message control support',
+    13: 'Call Control by NAA',
+    14: 'UCS2 Entry supported',
+    15: 'UCS2 Display supported',
+    16: 'Display Text',
 
-     # third byte
-     17: 'Proactive UICC: DISPLAY TEXT',
-     18: 'Proactive UICC: GET INKEY',
-     19: 'Proactive UICC: GET INPUT',
-     20: 'Proactive UICC: MORE TIME',
-     21: 'Proactive UICC: PLAY TONE',
-     22: 'Proactive UICC: POLL INTERVAL',
-     23: 'Proactive UICC: POLLING OFF',
-     24: 'Proactive UICC: REFRESH',
+    # third byte
+    17: 'Proactive UICC: DISPLAY TEXT',
+    18: 'Proactive UICC: GET INKEY',
+    19: 'Proactive UICC: GET INPUT',
+    20: 'Proactive UICC: MORE TIME',
+    21: 'Proactive UICC: PLAY TONE',
+    22: 'Proactive UICC: POLL INTERVAL',
+    23: 'Proactive UICC: POLLING OFF',
+    24: 'Proactive UICC: REFRESH',
 
-     # fourth byte
-     25: 'Proactive UICC: SELECT ITEM',
-     26: 'Proactive UICC: SEND SHORT MESSAGE with 3GPP-SMS-TPDU',
-     27: 'Proactive UICC: SEND SS',
-     28: 'Proactive UICC: SEND USSD',
-     29: 'Proactive UICC: SET UP CALL',
-     30: 'Proactive UICC: SET UP MENU',
-     31: 'Proactive UICC: PROVIDE LOCAL INFORMATION (MCC, MNC, LAC, Cell ID & IMEI)',
-     32: 'Proactive UICC: PROVIDE LOCAL INFORMATION (NMR)',
+    # fourth byte
+    25: 'Proactive UICC: SELECT ITEM',
+    26: 'Proactive UICC: SEND SHORT MESSAGE with 3GPP-SMS-TPDU',
+    27: 'Proactive UICC: SEND SS',
+    28: 'Proactive UICC: SEND USSD',
+    29: 'Proactive UICC: SET UP CALL',
+    30: 'Proactive UICC: SET UP MENU',
+    31: 'Proactive UICC: PROVIDE LOCAL INFORMATION (MCC, MNC, LAC, Cell ID & IMEI)',
+    32: 'Proactive UICC: PROVIDE LOCAL INFORMATION (NMR)',
 
-     # fifth byte
-     33: 'Proactive UICC: SET UP EVENT LIST',
-     34: 'Event: MT call',
-     35: 'Event: Call connected',
-     36: 'Event: Call disconnected',
-     37: 'Event: Location status',
-     38: 'Event: User activity',
-     39: 'Event: Idle screen available',
-     40: 'Event: Card reader status',
+    # fifth byte
+    33: 'Proactive UICC: SET UP EVENT LIST',
+    34: 'Event: MT call',
+    35: 'Event: Call connected',
+    36: 'Event: Call disconnected',
+    37: 'Event: Location status',
+    38: 'Event: User activity',
+    39: 'Event: Idle screen available',
+    40: 'Event: Card reader status',
 
-     # sixth byte
-     41: 'Event: Language selection',
-     42: 'Event: Browser Termination',
-     43: 'Event: Data aailable',
-     44: 'Event: Channel status',
-     45: 'Event: Access Technology Change',
-     46: 'Event: Display parameters changed',
-     47: 'Event: Local Connection',
-     48: 'Event: Network Search Mode Change',
+    # sixth byte
+    41: 'Event: Language selection',
+    42: 'Event: Browser Termination',
+    43: 'Event: Data aailable',
+    44: 'Event: Channel status',
+    45: 'Event: Access Technology Change',
+    46: 'Event: Display parameters changed',
+    47: 'Event: Local Connection',
+    48: 'Event: Network Search Mode Change',
 
-     # seventh byte
-     49: 'Proactive UICC: POWER ON CARD',
-     50: 'Proactive UICC: POWER OFF CARD',
-     51: 'Proactive UICC: PERFORM CARD RESET',
-     52: 'Proactive UICC: GET READER STATUS (Card reader status)',
-     53: 'Proactive UICC: GET READER STATUS (Card reader identifier)',
-     # RFU: 3 bit (54,55,56)
+    # seventh byte
+    49: 'Proactive UICC: POWER ON CARD',
+    50: 'Proactive UICC: POWER OFF CARD',
+    51: 'Proactive UICC: PERFORM CARD RESET',
+    52: 'Proactive UICC: GET READER STATUS (Card reader status)',
+    53: 'Proactive UICC: GET READER STATUS (Card reader identifier)',
+    # RFU: 3 bit (54,55,56)
 
-     # eighth byte
-     57: 'Proactive UICC: TIMER MANAGEMENT (start, stop)',
-     58: 'Proactive UICC: TIMER MANAGEMENT (get current value)',
-     59: 'Proactive UICC: PROVIDE LOCAL INFORMATION (date, time and time zone)',
-     60: 'GET INKEY',
-     61: 'SET UP IDLE MODE TEXT',
-     62: 'RUN AT COMMAND',
-     63: 'SETUP CALL',
-     64: 'Call Control by NAA',
+    # eighth byte
+    57: 'Proactive UICC: TIMER MANAGEMENT (start, stop)',
+    58: 'Proactive UICC: TIMER MANAGEMENT (get current value)',
+    59: 'Proactive UICC: PROVIDE LOCAL INFORMATION (date, time and time zone)',
+    60: 'GET INKEY',
+    61: 'SET UP IDLE MODE TEXT',
+    62: 'RUN AT COMMAND',
+    63: 'SETUP CALL',
+    64: 'Call Control by NAA',
 
-     # ninth byte
-     65: 'DISPLAY TEXT',
-     66: 'SEND DTMF command',
-     67: 'Proactive UICC: PROVIDE LOCAL INFORMATION (NMR)',
-     68: 'Proactive UICC: PROVIDE LOCAL INFORMATION (language)',
-     69: 'Proactive UICC: PROVIDE LOCAL INFORMATION (Timing Advance)',
-     70: 'Proactive UICC: LANGUAGE NOTIFICATION',
-     71: 'Proactive UICC: LAUNCH BROWSER',
-     72: 'Proactive UICC: PROVIDE LOCAL INFORMATION (Access Technology)',
+    # ninth byte
+    65: 'DISPLAY TEXT',
+    66: 'SEND DTMF command',
+    67: 'Proactive UICC: PROVIDE LOCAL INFORMATION (NMR)',
+    68: 'Proactive UICC: PROVIDE LOCAL INFORMATION (language)',
+    69: 'Proactive UICC: PROVIDE LOCAL INFORMATION (Timing Advance)',
+    70: 'Proactive UICC: LANGUAGE NOTIFICATION',
+    71: 'Proactive UICC: LAUNCH BROWSER',
+    72: 'Proactive UICC: PROVIDE LOCAL INFORMATION (Access Technology)',
 
-     # tenth byte
-     73: 'Soft keys support for SELECT ITEM',
-     74: 'Soft keys support for SET UP MENU ITEM',
-     # RFU: 6 bit (75-80)
+    # tenth byte
+    73: 'Soft keys support for SELECT ITEM',
+    74: 'Soft keys support for SET UP MENU ITEM',
+    # RFU: 6 bit (75-80)
 
-     # eleventh byte: max number of soft keys as 8bit value (81..88)
+    # eleventh byte: max number of soft keys as 8bit value (81..88)
 
-     # twelfth byte
-     89: 'Proactive UICC: OPEN CHANNEL',
-     90: 'Proactive UICC: CLOSE CHANNEL',
-     91: 'Proactive UICC: RECEIVE DATA',
-     92: 'Proactive UICC: SEND DATA',
-     93: 'Proactive UICC: GET CHANNEL STATUS',
-     94: 'Proactive UICC: SERVICE SEARCH',
-     95: 'Proactive UICC: GET SERVICE INFORMATION',
-     96: 'Proactive UICC: DECLARE SERVICE',
+    # twelfth byte
+    89: 'Proactive UICC: OPEN CHANNEL',
+    90: 'Proactive UICC: CLOSE CHANNEL',
+    91: 'Proactive UICC: RECEIVE DATA',
+    92: 'Proactive UICC: SEND DATA',
+    93: 'Proactive UICC: GET CHANNEL STATUS',
+    94: 'Proactive UICC: SERVICE SEARCH',
+    95: 'Proactive UICC: GET SERVICE INFORMATION',
+    96: 'Proactive UICC: DECLARE SERVICE',
 
-     # thirteenth byte
-     97: 'BIP supported Bearer: CSD',
-     98: 'BIP supported Bearer: GPRS',
-     99: 'BIP supported Bearer: Bluetooth',
-     100: 'BIP supported Bearer: IrDA',
-     101: 'BIP supported Bearer: RS232',
-     # 3 bits: number of channels supported (102..104)
+    # thirteenth byte
+    97: 'BIP supported Bearer: CSD',
+    98: 'BIP supported Bearer: GPRS',
+    99: 'BIP supported Bearer: Bluetooth',
+    100: 'BIP supported Bearer: IrDA',
+    101: 'BIP supported Bearer: RS232',
+    # 3 bits: number of channels supported (102..104)
 
-     # fourtheenth byte (screen height)
-     # fifteenth byte (screen width)
-     # sixeenth byte (screen effects)
-     # seventeenth byte (BIP supported bearers)
-     129: 'BIP: TCP, UICC in client mode, remote connection',
-     130: 'BIP: UDP, UICC in client mode, remote connection',
-     131: 'BIP: TCP, UICC in server mode',
-     132: 'BIP: TCP, UICC in client mode, local connection',
-     133: 'BIP: UDP, UICC in client mode, local connection',
-     134: 'BIP: direct communication channel',
-     # 2 bits reserved: 135, 136
+    # fourtheenth byte (screen height)
+    # fifteenth byte (screen width)
+    # sixeenth byte (screen effects)
+    # seventeenth byte (BIP supported bearers)
+    129: 'BIP: TCP, UICC in client mode, remote connection',
+    130: 'BIP: UDP, UICC in client mode, remote connection',
+    131: 'BIP: TCP, UICC in server mode',
+    132: 'BIP: TCP, UICC in client mode, local connection',
+    133: 'BIP: UDP, UICC in client mode, local connection',
+    134: 'BIP: direct communication channel',
+    # 2 bits reserved: 135, 136
 
-     # FIXME: remainder
+    # FIXME: remainder
 }