diff options
author | duke2906 <philipp.prangenberg@gmail.com> | 2016-09-26 15:09:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-26 15:09:20 +0200 |
commit | 960bf899414d89221e92138fdb98777c3f4f73ec (patch) | |
tree | 87f5fd96185aa5f2fff0f84e2e2fa8be379ee837 /tools | |
parent | 0d3c05a24992eeeba02032e474d3a9bbb3239f10 (diff) | |
parent | aaec58aec04256845dc37afd713b488071b1406b (diff) | |
download | trackermap-server-960bf899414d89221e92138fdb98777c3f4f73ec.tar.gz trackermap-server-960bf899414d89221e92138fdb98777c3f4f73ec.tar.bz2 trackermap-server-960bf899414d89221e92138fdb98777c3f4f73ec.zip |
Merge pull request #1 from tananaev/master
Update Changes, including version 3.7
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/hex.sh | 20 | ||||
-rw-r--r-- | tools/minify.bat | 5 | ||||
-rwxr-xr-x | tools/minify.sh | 14 | ||||
-rwxr-xr-x | tools/translate.py | 35 |
4 files changed, 14 insertions, 60 deletions
diff --git a/tools/hex.sh b/tools/hex.sh index cfae14bb6..78cd8fa38 100755 --- a/tools/hex.sh +++ b/tools/hex.sh @@ -10,26 +10,34 @@ if [ $# -lt 2 ] then - echo "USAGE: $0 <port> <hex>" + echo "USAGE: $0 <host> <port> <hex>" + echo "If only <port> and <hex> are present, <host> defaults to localhost." exit 1 fi +host="$1"; port="$2"; hex="$3"; + +if [ $# -eq 2 ] +then + host="localhost"; port="$1"; hex="$2"; +fi + send_hex_udp () { - echo $2 | xxd -r -p | nc -u -w 0 localhost $1 + echo "$hex" | xxd -r -p | nc -u -w 0 "$host" "$port" } send_hex_tcp () { - echo $2 | xxd -r -p | nc localhost $1 + echo "$hex" | xxd -r -p | nc "$host" "$port" } send_text_udp () { - echo -n -e $2 | nc -u -w 0 localhost $1 + echo -n -e "$hex" | nc -u -w 0 "$host" "$port" } send_text_tcp () { - echo -n -e $2 | nc localhost $1 + echo -n -e "$hex" | nc "$host" "$port" } -send_hex_tcp $1 $2 +send_hex_tcp "$host" "$port" "$hex" exit $? diff --git a/tools/minify.bat b/tools/minify.bat deleted file mode 100644 index 6ab8fd94b..000000000 --- a/tools/minify.bat +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -cd C:\[traccar path]\traccar\web -set SDK=C:\[sencha path]\ext-6.0.0 - -sencha -sdk %SDK% compile -classpath=app.js,app,%SDK%\packages\core\src,%SDK%\packages\core\overrides,%SDK%\classic\classic\src,%SDK%\classic\classic\overrides exclude -all and include -recursive -file app.js and exclude -namespace=Ext and concatenate -closure app.min.js diff --git a/tools/minify.sh b/tools/minify.sh deleted file mode 100755 index 4a5c47f9d..000000000 --- a/tools/minify.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -cd $(dirname $0)/../web - -SDK="../../ext-6.0.1" - -sencha compile --classpath=app.js,app,$SDK/packages/core/src,$SDK/packages/core/overrides,$SDK/classic/classic/src,$SDK/classic/classic/overrides \ - exclude -all \ - and \ - include -recursive -file app.js \ - and \ - exclude -namespace=Ext \ - and \ - concatenate -closure app.min.js diff --git a/tools/translate.py b/tools/translate.py deleted file mode 100755 index e8324a61a..000000000 --- a/tools/translate.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/python - -import os -import optparse -import urllib2 -import json -import base64 - -parser = optparse.OptionParser() -parser.add_option("-u", "--user", dest="username", help="transifex user login") -parser.add_option("-p", "--password", dest="password", help="transifex user password") - -(options, args) = parser.parse_args() - -if not options.username or not options.password: - parser.error('User name and password are required') - -os.chdir(os.path.dirname(os.path.abspath(__file__))) - -path = "../web/l10n/" - -def request(url): - req = urllib2.Request(url) - auth = base64.encodestring("%s:%s" % (options.username, options.password)).replace("\n", "") - req.add_header("Authorization", "Basic %s" % auth) - return urllib2.urlopen(req) - -resource = json.load(request("https://www.transifex.com/api/2/project/traccar/resource/web/?details")) - -for language in resource["available_languages"]: - code = language["code"] - data = request("https://www.transifex.com/api/2/project/traccar/resource/web/translation/" + code + "?file") - file = open(path + code + ".json", "wb") - file.write(data.read()) - file.close() |