cc3200: Rename 'server' class to 'Server' for consistency.

This commit is contained in:
danicampora 2016-02-22 22:51:22 +01:00
parent 12547ce737
commit add930c4b5
5 changed files with 14 additions and 14 deletions

View File

@ -153,7 +153,7 @@ STATIC const mp_map_elem_t mp_module_network_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_WLAN), (mp_obj_t)&mod_network_nic_type_wlan }, { MP_OBJ_NEW_QSTR(MP_QSTR_WLAN), (mp_obj_t)&mod_network_nic_type_wlan },
#if (MICROPY_PORT_HAS_TELNET || MICROPY_PORT_HAS_FTP) #if (MICROPY_PORT_HAS_TELNET || MICROPY_PORT_HAS_FTP)
{ MP_OBJ_NEW_QSTR(MP_QSTR_server), (mp_obj_t)&network_server_type }, { MP_OBJ_NEW_QSTR(MP_QSTR_Server), (mp_obj_t)&network_server_type },
#endif #endif
}; };
@ -177,7 +177,7 @@ STATIC MP_DEFINE_CONST_DICT(network_server_locals_dict, network_server_locals_di
STATIC const mp_obj_type_t network_server_type = { STATIC const mp_obj_type_t network_server_type = {
{ &mp_type_type }, { &mp_type_type },
.name = MP_QSTR_server, .name = MP_QSTR_Server,
.make_new = network_server_make_new, .make_new = network_server_make_new,
.locals_dict = (mp_obj_t)&network_server_locals_dict, .locals_dict = (mp_obj_t)&network_server_locals_dict,
}; };

View File

@ -279,7 +279,7 @@ Q(CERT_REQUIRED)
// for network class // for network class
Q(network) Q(network)
Q(server) Q(Server)
Q(init) Q(init)
Q(deinit) Q(deinit)
Q(login) Q(login)

View File

@ -30,27 +30,27 @@ For example::
.. only:: port_wipy .. only:: port_wipy
.. _network.server: .. _network.Server:
class server class Server
============ ============
The server class controls the behaviour and the configuration of the FTP and telnet The ``Server`` class controls the behaviour and the configuration of the FTP and telnet
services running on the WiPy. Any changes performed using this class' methods will services running on the WiPy. Any changes performed using this class' methods will
affect both. affect both.
Example:: Example::
import network import network
s = network.server() server = network.Server()
s.deinit() # disable the server server.deinit() # disable the server
# enable the server again with new settings # enable the server again with new settings
s.init(login=('user', 'password'), timeout=600) server.init(login=('user', 'password'), timeout=600)
Constructors Constructors
------------ ------------
.. class:: network.server(id, ...) .. class:: network.Server(id, ...)
Create a server instance, see ``init`` for parameters of initialization. Create a server instance, see ``init`` for parameters of initialization.

View File

@ -201,12 +201,12 @@ See :ref:`network.WLAN <network.WLAN>` and :mod:`machine`. ::
Telnet and FTP server Telnet and FTP server
--------------------- ---------------------
See :ref:`network.server <network.server>` :: See :ref:`network.Server <network.Server>` ::
from network import server from network import Server
# init with new user, password and seconds timeout # init with new user, password and seconds timeout
server = server.init(login=('user', 'password'), timeout=60) server = Server(login=('user', 'password'), timeout=60)
server.timeout(300) # change the timeout server.timeout(300) # change the timeout
server.timeout() # get the timeout server.timeout() # get the timeout
server.isrunning() # check wether the server is running or not server.isrunning() # check wether the server is running or not

View File

@ -9,7 +9,7 @@ mch = os.uname().machine
if not 'LaunchPad' in mch and not'WiPy' in mch: if not 'LaunchPad' in mch and not'WiPy' in mch:
raise Exception('Board not supported!') raise Exception('Board not supported!')
server = network.server() server = network.Server()
print(server.timeout() == 300) print(server.timeout() == 300)
print(server.isrunning() == True) print(server.isrunning() == True)