Skip to content

Commit 458cb29

Browse files
ebroeckerhardbyte
authored andcommitted
reverse renaming of modules
use from __future__ import to avoid namespace collisions
1 parent b0ce54f commit 458cb29

21 files changed

Lines changed: 33 additions & 32 deletions

can/CAN.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from can.message import Message
1010
from can.listener import Listener, BufferedReader, RedirectReader
1111
from can.util import set_logging_level
12-
from can.formated_io import *
12+
from can.io import *
1313

1414
import logging
1515

can/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ class CanError(IOError):
1717

1818
from can.listener import Listener, BufferedReader, RedirectReader
1919

20-
from can.formated_io import Logger, Printer, LogReader
21-
from can.formated_io import ASCWriter
22-
from can.formated_io import BLFReader, BLFWriter
23-
from can.formated_io import CSVWriter
24-
from can.formated_io import SqliteWriter, SqlReader
20+
from can.io import Logger, Printer, LogReader
21+
from can.io import ASCWriter
22+
from can.io import BLFReader, BLFWriter
23+
from can.io import CSVWriter
24+
from can.io import SqliteWriter, SqlReader
2525

2626
from can.util import set_logging_level
2727

can/interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
'kvaser': ('can.interfaces.kvaser', 'KvaserBus'),
1212
'socketcan_ctypes': ('can.interfaces.socketcan', 'SocketcanCtypes_Bus'),
1313
'socketcan_native': ('can.interfaces.socketcan', 'SocketcanNative_Bus'),
14-
'basic_serial': ('can.interfaces.basic_serial.serial_can', 'SerialBus'),
14+
'serial': ('can.interfaces.serial.serial_can', 'SerialBus'),
1515
'pcan': ('can.interfaces.pcan', 'PcanBus'),
1616
'usb2can': ('can.interfaces.usb2can', 'Usb2canBus'),
1717
'ixxat': ('can.interfaces.ixxat', 'IXXATBus'),

can/interfaces/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
Interfaces contain low level implementations that interact with CAN hardware.
44
"""
55

6-
VALID_INTERFACES = set(['kvaser', 'basic_serial', 'pcan', 'socketcan_native',
6+
VALID_INTERFACES = set(['kvaser', 'serial', 'pcan', 'socketcan_native',
77
'socketcan_ctypes', 'socketcan', 'usb2can', 'ixxat',
88
'nican', 'iscan', 'vector', 'remote', 'virtual', 'neovi','slcan'])

can/interfaces/basic_serial/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

can/interfaces/serial/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from can.interfaces.serial.serial_can import SerialBus as Bus
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
import logging
99

10-
logger = logging.getLogger('can.basic_serial')
10+
logger = logging.getLogger('can.serial')
1111

1212
try:
1313
import serial
1414
except ImportError:
15-
logger.error("You won't be able to use the basic_serial can backend without the basic_serial module installed!")
15+
logger.error("You won't be able to use the serial can backend without the serial module installed!")
1616
serial = None
1717

1818
from can.bus import BusABC
@@ -22,22 +22,22 @@
2222
class SerialBus(BusABC):
2323

2424
def __init__(self, channel, *args, **kwargs):
25-
"""A basic_serial interface to CAN.
25+
"""A serial interface to CAN.
2626
2727
:param str channel:
28-
The basic_serial device to open.
28+
The serial device to open.
2929
"""
3030
if channel == '':
31-
raise TypeError("Must specify a basic_serial port.")
31+
raise TypeError("Must specify a serial port.")
3232
else:
3333
self.channel_info = "Serial interface: " + channel
3434

35-
# Note: Some basic_serial port implementations don't care about the baud rate
35+
# Note: Some serial port implementations don't care about the baud rate
3636
self.ser = serial.Serial(channel, baudrate=115200, timeout=0.1)
3737
super(SerialBus, self).__init__(*args, **kwargs)
3838

3939
def send(self, msg, timeout=None):
40-
raise NotImplementedError("This basic_serial interface doesn't support transmit.")
40+
raise NotImplementedError("This serial interface doesn't support transmit.")
4141

4242
def recv(self, timeout=None):
4343

can/interfaces/slcan.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Interface for slcan compatible interfaces (win32/linux).
33
(Linux could use slcand/socketcan also).
44
"""
5+
from __future__ import absolute_import
56

67
import serial
78
import io
@@ -32,9 +33,9 @@ def close(self):
3233
def __init__(self, channel, ttyBaudrate=115200, timeout=1, bitrate=None, poll_interval=0.01 , **kwargs):
3334
"""
3435
:param string channel:
35-
port of underlying basic_serial or usb device (e.g. /dev/ttyUSB0, COM8, ...)
36+
port of underlying serial or usb device (e.g. /dev/ttyUSB0, COM8, ...)
3637
:param int ttyBaudrate:
37-
baudrate of underlying basic_serial or usb device
38+
baudrate of underlying serial or usb device
3839
:param int bitrate:
3940
Bitrate in bits/s
4041
:param float poll_interval:

can/interfaces/usb2can/serial_selector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def serial():
2929

3030
for objItem in colItems:
3131
string = objItem.Dependent
32-
# find based on beginning of basic_serial
32+
# find based on beginning of serial
3333
if "ED" in string:
3434
# print "Dependent:" + ` objItem.Dependent`
3535
string = string[len(string) - 9:len(string) - 1]

can/interfaces/usb2can/usb2canInterface.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ class Usb2canBus(BusABC):
7676
Note the USB2CAN interface doesn't implement set_filters, or flush_tx_buffer methods.
7777
7878
:param str channel:
79-
The device's basic_serial number. If not provided, Windows Management Instrumentation
80-
will be used to identify the first such device. The *kwarg* `basic_serial` may also be
79+
The device's serial number. If not provided, Windows Management Instrumentation
80+
will be used to identify the first such device. The *kwarg* `serial` may also be
8181
used.
8282
8383
:param int bitrate:
@@ -99,9 +99,9 @@ def __init__(self, channel, *args, **kwargs):
9999
else:
100100
enable_flags = 0x00000008
101101

102-
# code to get the basic_serial number of the device
103-
if 'basic_serial' in kwargs:
104-
deviceID = kwargs["basic_serial"]
102+
# code to get the serial number of the device
103+
if 'serial' in kwargs:
104+
deviceID = kwargs["serial"]
105105
elif channel is not None:
106106
deviceID = channel
107107
else:

0 commit comments

Comments
 (0)