Skip to content

Commit

Permalink
fix Python 2 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Mar 16, 2017
1 parent ceb524e commit 7686b2c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 10 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ matrix:
- docker
env: JOB_TYPE=prerelease UNDERLAY_REPOSITORY_NAMES="roscpp_core" OVERLAY_PACKAGE_NAMES=roscpp
before_script:
- pip3 install EmPy
# install catkin for test results
- sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros.list'
- sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
Expand Down
11 changes: 8 additions & 3 deletions ros_buildfarm/debian_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@
import os
import socket
import time
from urllib.error import HTTPError
from urllib.error import URLError
from urllib.request import urlopen
try:
from urllib.error import HTTPError
from urllib.error import URLError
from urllib.request import urlopen
except ImportError:
from urllib2 import HTTPError
from urllib2 import URLError
from urllib2 import urlopen


def get_debian_repo_data(debian_repository_baseurl, targets, cache_dir):
Expand Down
2 changes: 2 additions & 0 deletions ros_buildfarm/rosdoc_lite.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import print_function

import sys

import yaml
Expand Down
7 changes: 5 additions & 2 deletions ros_buildfarm/status_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,9 +588,12 @@ def _filter_tag_wrap(label):


def _name_query_wrap(name):
import urllib
try:
from urllib.parse import quote
except ImportError:
from urllib import quote
query = 'id="{0}"'.format(name)
return '<a href="?q={0}">{1}</a>'.format(urllib.parse.quote(query), name)
return '<a href="?q={0}">{1}</a>'.format(quote(query), name)


def _format_repo_table_row(name, data):
Expand Down
17 changes: 12 additions & 5 deletions scripts/status/build_release_compare_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,18 @@
import argparse
import sys

from ros_buildfarm.argument import add_argument_config_url
from ros_buildfarm.argument import add_argument_older_rosdistro_names
from ros_buildfarm.argument import add_argument_output_dir
from ros_buildfarm.argument import add_argument_rosdistro_name
from ros_buildfarm.status_page import build_release_compare_page
try:
# while this is not supposed to be done I don't see a different way atm
reload(sys)
sys.setdefaultencoding('utf-8')
except NameError:
pass

from ros_buildfarm.argument import add_argument_config_url # noqa
from ros_buildfarm.argument import add_argument_older_rosdistro_names # noqa
from ros_buildfarm.argument import add_argument_output_dir # noqa
from ros_buildfarm.argument import add_argument_rosdistro_name # noqa
from ros_buildfarm.status_page import build_release_compare_page # noqa


def main(argv=sys.argv[1:]):
Expand Down

0 comments on commit 7686b2c

Please sign in to comment.