Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

make python-ostinato python3 compliant (work in progress) #181

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
python3: run futurize stage2
  • Loading branch information
little-dude committed May 5, 2016
commit 832999cc08f7d1615baed8431338fdc93e62bc8c
1 change: 1 addition & 0 deletions binding/core.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import absolute_import
from builtins import object
# Copyright (C) 2014 Srivats P.
#
# This file is part of "Ostinato"
Expand Down
7 changes: 4 additions & 3 deletions binding/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# standard modules
from __future__ import print_function
from __future__ import absolute_import
from builtins import input
import logging
import os
import sys
Expand Down Expand Up @@ -53,7 +54,7 @@
print('')

if not use_defaults:
s = raw_input('Drone\'s Hostname/IP [%s]: ' % (host_name))
s = input('Drone\'s Hostname/IP [%s]: ' % (host_name))
host_name = s or host_name

drone = DroneProxy(host_name)
Expand Down Expand Up @@ -87,11 +88,11 @@
rx_port_number = port.port_id.id

if not use_defaults:
p = raw_input('Tx Port Id [%d]: ' % (tx_port_number))
p = input('Tx Port Id [%d]: ' % (tx_port_number))
if p:
tx_port_number = int(p)

p = raw_input('Rx Port Id [%d]: ' % (rx_port_number))
p = input('Rx Port Id [%d]: ' % (rx_port_number))
if p:
rx_port_number = int(p)

Expand Down
3 changes: 2 additions & 1 deletion binding/rpc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import print_function
from builtins import str
# Copyright (C) 2014 Srivats P.
#
# This file is part of "Ostinato"
Expand Down Expand Up @@ -123,7 +124,7 @@ def CallMethod(self, method, controller, request, response_class, done):
elif msg_type == MSG_TYPE_BLOB:
response = resp
elif msg_type == MSG_TYPE_ERROR:
raise RpcError(unicode(resp, 'utf-8'))
raise RpcError(str(resp, 'utf-8'))
else:
raise RpcError('unknown RPC msg type %d' % msg_type)

Expand Down