######################### Server passwords ##################################### # The "encoder_password" is used from the sources to log in.
encoder_password *********
#################### Server IP/port configuration ############################## # The server_name specifies the hostname of the server and must not be set to # an IP-adress. It is very important that server_name resolves to the IP-adress # the server is running at. # For every port, the server should listen to, a new port line can be added.
server_name testname #port 80 port 8000
######################## Main Server Logfile ################################## # logfile contains information about connections, warnings, errors etc.
logdir /opt/logs logfile ntripcaster.log
############################ Access Control ################################### # Here you specify which users have access to which mountpoints, # one line per mount. # # Syntax: /<MOUNTPOINT>:<USER1>:<PASSWORD1>,<USER2>:<PASSWORD2>,...,<USERn>:<PASSWORDn> # # /<MOUNTPOINT>: name of the mountpoint. Must start with a slash. # <USERi>: name of the user that has access to <MOUNTPOINT>. # <PASSWORDi>: password of <USERi>. #
root@raspberrypi:/opt/bin# ./ntripcaster NtripCaster Version 0.1.5 Initializing... NtripCaster comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of NtripCaster under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING. Starting thread engine... [19/Jul/2019:21:45:54] NtripCaster Version 0.1.5 Starting.. [19/Jul/2019:21:45:54] Using stdout as NtripCaster logging window [19/Jul/2019:21:45:54] Starting main connection handler... [19/Jul/2019:21:46:14] WARNING: Resolving the server name [testname] does not work! [19/Jul/2019:21:46:14] Listening on port 8000... [19/Jul/2019:21:46:14] Using 'testname' as servername... [19/Jul/2019:21:46:14] Server limits: 100 clients, 100 clients per source, 40 sources [19/Jul/2019:21:46:14] Starting Calender Thread... [19/Jul/2019:21:46:14] Bandwidth:0.000000KB/s Sources:0 Clients:0 [19/Jul/2019:21:46:14] Accepted encoder on mountpoint /FFMJ2 from 10.18.45.156. 2 sources connected [19/Jul/2019:21:46:14] Accepted encoder on mountpoint /AB0 from 10.18.45.156. 2 sources connected [19/Jul/2019:21:46:14] Kicking source 0 [10.18.45.156] [Source signed off (killed itself)] [encoder], connected for 0 seconds, 0 bytes transfered. 1 sources connected [19/Jul/2019:21:46:14] Kicking all 0 clients forsource 0 [19/Jul/2019:21:46:14] Kicking source 1 [10.18.45.156] [Source signed off (killed itself)] [encoder], connected for 0 seconds, 0 bytes transfered. 0 sources connected [19/Jul/2019:21:46:14] Kicking all 0 clients forsource 1
result = [] for k, vs in to_key_val_list(data): if isinstance(vs, basestring) or not hasattr(vs, '__iter__'): vs = [vs] for v in vs: if v is not None: result.append( (k.encode('utf-8') if isinstance(k, str) else k, v.encode('utf-8') if isinstance(v, str) else v)) return urlencode(result, doseq=True)
result 在这里还是个list, 不用担心重复问题, 那么问题就一定是在for k, vs in to_key_val_list(data)了, to_key_val_list是utils.py里的一个函数, 简单粗暴
def items(self, multi=False): """Return an iterator of ``(key, value)`` pairs. :param multi: If set to `True` the iterator returned will have a pair for each value of each key. Otherwise it will only contain pairs for the first value of each key. """
for key, values in iteritems(dict, self): if multi: for value in values: yield key, value else: yield key, values[0]
for row in tables[0].rows: row_temp = [] for cell in row.cells: if cell.text != null_text: row_temp.append(cell.text) cell.text = null_text table_temp.append(row_temp) table_temp