Commit b0a39025 authored by Hebant Martin's avatar Hebant Martin
Browse files

Better log for remotepylint and start auto

parent cca7ff0f
......@@ -4,7 +4,7 @@ import os
os.chdir(os.path.dirname(os.path.abspath(__file__)))
import logging
logging.basicConfig(filename='pylint.log', filemode='w', level=logging.DEBUG, format='%(levelname)s: %(message)s')
logging.basicConfig(filename='pylint.log', filemode='a', level=logging.DEBUG, format='%(levelname)s: %(message)s')
import sys
import subprocess
......@@ -23,11 +23,16 @@ def main():
args = sys.argv[1:]
path = args[-1]
logging.debug("Call pylint for " + path)
if is_in_local_workspace(path):
args[-1] = to_remote_workspace(path)
call('pylint', args)
else:
subprocess.run(['pylint'] + sys.argv[1:])
try:
subprocess.run(['pylint'] + sys.argv[1:])
except Exception as e:
logging.error("Can't execute pylint locally")
def is_in_local_workspace(path):
return path.startswith(LOCAL_WORKSPACE)
......
......@@ -9,14 +9,16 @@ RUN apt-get install -y \
sudo && \
sed -i 's/%sudo.*ALL/%sudo ALL=(ALL:ALL) NOPASSWD:ALL/' /etc/sudoers
# Install dep for /remotepylint.py
RUN apt-get install -y \
python-pip && \
pip install -U pip
RUN pip install --ignore-installed pylint
COPY ./remotepylint.py /
# Setup ENTRYPOINT and CMD
COPY ./entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
CMD ["roscore"]
# Install yours packages here
RUN apt-get install -y \
python-pip && \
pip install -U pip
RUN pip install --ignore-installed pylint
COPY ./remotepylint.py /
\ No newline at end of file
......@@ -11,4 +11,5 @@ id -u ros &> /dev/null || ( # if user ros does not exist
# setup ros environment
source "/opt/ros/$ROS_DISTRO/setup.bash"
/remotepylint.py&
exec "$@"
......@@ -14,6 +14,8 @@ def main():
s.bind((HOST, PORT))
s.listen(1)
print('Remote pylint ready :)')
while True:
cxn, addr = s.accept()
request = json.loads(cxn.recv(BUFFER_SIZE).decode())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment