Skip to content

Commit

Permalink
get_dmrmarc_json.py: clarify python-requests requirment
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansaraev committed Mar 16, 2018
1 parent 8146c85 commit 24b2a25
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
5 changes: 3 additions & 2 deletions README.de.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,19 @@ Ebenso sind zur Nutzung folgende Pakete erforderlich:
* Python 2.7 or newer: http://www.python.org
* PyUSB 1.0: (0.4 does not work.) http://sourceforge.net/apps/mediawiki/pyusb/
* libusb 1.0: (0.4 does not work.) http://www.libusb.org/
* python-requests: http://python-requests.org/

#### Automatische Installation der benötigten Pakete

Debian Stretch:

apt-get install gcc-arm-none-eabi binutils-arm-none-eabi \
libnewlib-arm-none-eabi libusb-1.0 python-usb
libnewlib-arm-none-eabi libusb-1.0 python-usb python-requests

Debian Jessie / Ubuntu 16.04 LTS:

apt-get install gcc-arm-none-eabi binutils-arm-none-eabi libusb-1.0 git \
libnewlib-arm-none-eabi make curl python-pip unzip
libnewlib-arm-none-eabi make curl python-pip python-requests unzip
pip install pyusb -U # update PyUSB to 1.0


Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ repository. We use a heap-less printf library under the BSD license.
* libusb 1.0: (0.4 does not work.)
http://www.libusb.org/

* python-requests
http://python-requests.org/

This project should work across Linux, Mac OS, and Windows, but has
not been tested on all platforms. A separate client, MD380Tool,
is under development for Android.
Expand Down
2 changes: 1 addition & 1 deletion db/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dmrmarc2.tmp: dmrmarc.tmp
awk -F, -f insert_nick.awk <$< >$@

dmrmarc.tmp:
python2 get_dmrmarc_json.py >$@ 2>get_dmrmarc.errors
python2 get_dmrmarc_json.py >$@

reflector.tmp:
curl $(CURL_FLAGS) 'http://registry.dstar.su/reflector.db' | perl -pe '$$_ = "" if ( $$. == 1 ); s#@#,#; s#@.*#,,,,,,#' >$@
Expand Down
8 changes: 7 additions & 1 deletion db/get_dmrmarc_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@
# KD4Z
# dmr-marc decided to stop offering CSV output format, so json here we come

import requests
import sys

try:
import requests
except ImportError as e:
sys.stderr.write('\n' + str(e) + '\n')
sys.stderr.write('\nERROR: please install python-requests\n\n')
exit(127)

def noCommas(field):
try:

Expand Down
4 changes: 2 additions & 2 deletions docs/debian.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#### Debian Stretch: ####

apt-get install gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi \
libusb-1.0 python-usb make curl
libusb-1.0 python-usb python-requests make curl

#### Debian Jessie (using backports.debian.org): ####

Expand All @@ -23,7 +23,7 @@ Install python-usb from backports, the rest from Jessie

apt -t jessie-backports install python-usb
apt install gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi \
libusb-1.0 make curl
libusb-1.0 make curl python-requests

#### Debian Jessie (using python-pip): ####

Expand Down
2 changes: 1 addition & 1 deletion docs/raspi.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Tested on 2016-05-10-raspbian-jessie by IZ2XBZ
```
sudo apt-get install gcc-arm-none-eabi binutils-arm-none-eabi libusb-1.0 \
libnewlib-arm-none-eabi make curl
libnewlib-arm-none-eabi make curl python-requests
Tested on 2017-03-02-raspbian-jessie by YT5ZEC (dragstor):
In addition to the notes above, install the following pip package, in order to get cable to work.
Expand Down

0 comments on commit 24b2a25

Please sign in to comment.