Skip to content

Commit 3c0870d

Browse files
authored
Merge branch 'master' into manufacturer-updates
2 parents 338ce2b + 515e681 commit 3c0870d

18 files changed

+409
-29
lines changed

.codespellignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(0x1BC0, "ALS Stanislaw Binkiewicz"),
2+
(0x030F, "Guangzhou Litewise Lighting Equipments Co., Ltd. dba \"EK Lights\""),

.travis-ci.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,22 @@ elif [[ $TASK = 'spellintian' ]]; then
3535
else
3636
echo "Found $spellingerrors spelling errors"
3737
fi;
38+
elif [[ $TASK = 'codespell' ]]; then
39+
# run codespell only if it is the requested task
40+
spellingfiles=$(find ./ -type f -and ! \( \
41+
-wholename "./.git/*" -or \
42+
-wholename "./node_modules/*" \
43+
\) | xargs)
44+
# count the number of codespell errors
45+
spellingerrors=$(zrun codespell --check-filenames --quiet 2 --regex "[a-zA-Z0-9][\\-'a-zA-Z0-9]+[a-zA-Z0-9]" --exclude-file .codespellignore $spellingfiles 2>&1 | wc -l)
46+
if [[ $spellingerrors -ne 0 ]]; then
47+
# print the output for info
48+
zrun codespell --check-filenames --quiet 2 --regex "[a-zA-Z0-9][\\-'a-zA-Z0-9]+[a-zA-Z0-9]" --exclude-file .codespellignore $spellingfiles
49+
echo "Found $spellingerrors spelling errors via codespell"
50+
exit 1;
51+
else
52+
echo "Found $spellingerrors spelling errors via codespell"
53+
fi;
3854
elif [[ $TASK = 'flake8' ]]; then
3955
flake8 --max-line-length 80 --exclude .git,__pycache --ignore E111,E114,E129 $(find ./ -name "*.py" | xargs)
4056
#,E121,E127

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ install:
2020
- if [ "$TASK" = "flake8" ]; then pip install flake8; fi
2121
# If this causes SSL errors, then Sourceforge is probably in disaster recovery mode and needing Javascript. Could switch to a specific mirror, e.g. kent.dl.sourceforge.net
2222
- if [ "$TASK" = "pychecker" -o "$TASK" = "pychecker-wip" ]; then pip install http://sourceforge.net/projects/pychecker/files/pychecker/0.8.19/pychecker-0.8.19.tar.gz/download; fi
23+
- if [ "$TASK" = "codespell" ]; then pip install git+https://github.com/lucasdemarchi/codespell.git; fi
2324

2425
matrix:
2526
fast_finish: true
@@ -42,6 +43,15 @@ matrix:
4243
apt:
4344
packages:
4445
- moreutils
46+
- os: linux
47+
dist: trusty
48+
# Short duration job, use the container/without sudo image as it boots faster
49+
sudo: false
50+
env: TASK='codespell'
51+
addons:
52+
apt:
53+
packages:
54+
- moreutils
4555
- os: linux
4656
dist: trusty
4757
env: TASK='flake8'

admin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,14 +655,14 @@ def DiffProperty(self, name, key, left_dict, right_dict):
655655
left = left_dict.get(key)
656656
right = right_dict.get(key)
657657
if left and right:
658-
left_formated, right_formatted = self._differ.Diff(str(left), str(right))
658+
left_formatted, right_formatted = self._differ.Diff(str(left), str(right))
659659
else:
660-
left_formated = left
660+
left_formatted = left
661661
right_formatted = right
662662
return {
663663
'name': name,
664664
'key': key,
665-
'left': left_formated,
665+
'left': left_formatted,
666666
'different': left != right,
667667
'prefer_left': left is not None and right is None,
668668
'prefer_right': right is not None and left is None,

common.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ def GetLatestSoftware(responder):
7474
A SoftwareVersion object or None.
7575
"""
7676
max_version = None
77-
version = None
77+
max_version_info = None
7878
for version in responder.software_version_set:
7979
if max_version is None or version.version_id > max_version:
8080
max_version = version.version_id
81-
version = version
82-
return version
81+
max_version_info = version
82+
return max_version_info
8383

8484

8585
def LookupProductCategory(category_id):

data/controller_data.py

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,53 +20,69 @@
2020
CONTROLLER_DATA = {
2121
0x0808: [
2222
{'name': 'Frog 2',
23-
'link': 'http://www.zero88.com/en/products/2/51',
23+
'link': 'http://support.zero88.com/975204871/',
2424
'image_url': 'http://zero88.com/wp-content/uploads/2008/04/Frog-2-11.png',
2525
'tags': ['console']},
2626
{'name': 'LeapFrog 48',
27-
'link': 'http://support.zero88.com/main/en/product/88',
27+
'link': 'http://support.zero88.com/975530941/',
2828
'image_url': 'http://www.performing-musician.com/pm/jun08/images/SPGTLjune_01.jpg',
2929
'tags': ['console']},
3030
{'name': 'LeapFrog 96',
31-
'link': 'http://support.zero88.com/main/en/product/88',
31+
'link': 'http://support.zero88.com/975530941/',
3232
'image_url': 'http://www.stageservicesshop.com/shop/image.php?type=T&id=16585',
3333
'tags': ['console']},
3434
{'name': 'Solution',
35-
'link': 'http://www.zero88.com/en/products/2/101',
35+
'link': 'http://zero88.com/products/consoles/solution/',
3636
'image_url': 'http://www.stagesuperstore.co.uk/ekmps/shops/stagesuperstore/images/zero88-solution-series-lighting-desk-2699-p.jpg',
3737
'tags': ['console']},
3838
{'name': 'Solution XL',
39-
'link': 'http://www.zero88.com/en/products/2/101',
39+
'link': 'http://zero88.com/products/consoles/solutionxl/',
4040
'image_url': 'http://www.stagesuperstore.co.uk/ekmps/shops/stagesuperstore/images/zero88-solution-series-lighting-desk-[3]-2699-p.jpg',
4141
'tags': ['console']},
4242
{'name': 'ORB XF',
43-
'link': 'http://www.zero88.com/en/products/2/100',
43+
'link': 'http://zero88.com/products/consoles/orbxf/',
4444
'image_url': 'http://zero88.com/wp-content/uploads/2011/11/ORB-XF-22.png',
4545
'tags': ['console']},
4646
{'name': 'ORB',
47-
'link': 'http://www.zero88.com/en/products/2/97',
47+
'link': 'http://support.zero88.com/975362971/',
4848
'image_url': 'http://zero88.com/wp-content/uploads/2009/11/ORB-12.png',
4949
'tags': ['console']},
5050
{'name': 'Jester ML',
51-
'link': 'http://www.zero88.com/en/products/2/89',
51+
'link': 'http://support.zero88.com/975199911/',
5252
'image_url': 'http://zero88.com/wp-content/uploads/2011/11/Jester-ML24-1.png',
5353
'tags': ['console']},
5454
{'name': 'Jester ML24',
55-
'link': 'http://www.zero88.com/en/products/2/89',
55+
'link': 'http://support.zero88.com/975199911/',
5656
'image_url': 'http://www.musik-produktiv.co.uk/pic-100049983xl/light-stage-consoles-scan-console-17456-zero-88-jester-ml-24.jpg',
5757
'tags': ['console']},
5858
{'name': 'Jester ML48',
59-
'link': 'http://www.zero88.com/en/products/2/89',
59+
'link': 'http://support.zero88.com/975199911/',
6060
'image_url': 'http://zero88.com/wp-content/uploads/2012/03/Jester-ML48-1.png',
6161
'tags': ['console']},
6262
{'name': 'Jester TL',
63-
'link': 'http://www.zero88.com/en/products/2/94',
63+
'link': 'http://support.zero88.com/975200381/',
6464
'image_url': 'http://www.eventgear.co.uk/shop/image/cache/data/Lighting%20Control/jester%20TL%20Desk-500x500.jpg',
6565
'tags': ['console']},
6666
{'name': 'Jester TLXtra',
67-
'link': 'http://www.zero88.com/en/products/2/94',
67+
'link': 'http://support.zero88.com/975200381/',
6868
'image_url': 'http://zero88.com/wp-content/uploads/2011/11/Jester-TLXtra-11.png',
6969
'tags': ['console']},
70+
{'name': 'FLX',
71+
'link': 'http://zero88.com/products/consoles/flx/',
72+
'image_url': 'http://zero88.com/images/product-pics-flx-1.jpg',
73+
'tags': ['console']},
74+
{'name': 'FLX S24',
75+
'link': 'http://zero88.com/products/consoles/flxs/',
76+
'image_url': 'http://zero88.com/images/product-pics-flx-s24.jpg',
77+
'tags': ['console']},
78+
{'name': 'FLX S48',
79+
'link': 'http://zero88.com/products/consoles/flxs/',
80+
'image_url': 'http://zero88.com/images/product-pics-flx-s48.jpg',
81+
'tags': ['console']},
82+
{'name': 'SCD Server Pro',
83+
'link': 'http://zero88.com/products/consoles/scdserver/',
84+
'image_url': 'http://zero88.com/images/product-pics-scd-server.jpg',
85+
'tags': ['console']},
7086
],
7187
0x22b9: [
7288
{'name': 'Etherlight-D1',

data/controller_test.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/python
2+
# This program is free software; you can redistribute it and/or modify
3+
# it under the terms of the GNU General Public License as published by
4+
# the Free Software Foundation; either version 2 of the License, or
5+
# (at your option) any later version.
6+
#
7+
# This program is distributed in the hope that it will be useful,
8+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
# GNU Library General Public License for more details.
11+
#
12+
# You should have received a copy of the GNU General Public License
13+
# along with this program; if not, write to the Free Software
14+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
15+
#
16+
# controller_test.py
17+
# Copyright (C) 2017 Peter Newman
18+
19+
import unittest
20+
21+
class TestControllerData(unittest.TestCase):
22+
""" Test the controller data files are valid."""
23+
def setUp(self):
24+
globals = {}
25+
locals = {}
26+
execfile("data/controller_data.py", globals, locals)
27+
self.data = locals['CONTROLLER_DATA']
28+
29+
def test_ControllerData(self):
30+
# Check the type
31+
self.assertEqual(type(self.data), dict)
32+
33+
for esta_id in self.data:
34+
self.assertEqual(int, type(esta_id))
35+
self.assertEqual(list, type(self.data[esta_id]))
36+
37+
seen_names = set()
38+
39+
for controller in self.data[esta_id]:
40+
name = controller['name']
41+
self.assertNotIn(name, seen_names,
42+
"Name %s for ESTA ID 0x%04x is present twice" % (name, esta_id))
43+
seen_names.add(name)
44+
45+
46+
if __name__ == '__main__':
47+
unittest.main()

data/manufacturer_links.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
(0x089D, "http://www.gobo.ws/"),
3333
(0x0987, "https://www.mathertel.de/"),
3434
(0x1AFA, "https://tmb.com/"),
35-
(0x15D0, "http://prolights.it/"),
35+
(0x15D0, "https://www.musiclights.it/"),
36+
#(0x15D0, "http://prolights.it/"), # This is one of their sub-brands
3637
(0x20B9, "https://www.arri.com/"),
3738
(0x21A4, "https://www.chauvetdj.com/"),
3839
(0x2122, "https://beglec.com/"),

data/model_test.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/python
2+
# This program is free software; you can redistribute it and/or modify
3+
# it under the terms of the GNU General Public License as published by
4+
# the Free Software Foundation; either version 2 of the License, or
5+
# (at your option) any later version.
6+
#
7+
# This program is distributed in the hope that it will be useful,
8+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
# GNU Library General Public License for more details.
11+
#
12+
# You should have received a copy of the GNU General Public License
13+
# along with this program; if not, write to the Free Software
14+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
15+
#
16+
# model_test.py
17+
# Copyright (C) 2017 Peter Newman
18+
19+
import unittest
20+
21+
class TestDeviceModelData(unittest.TestCase):
22+
""" Test the device model data files are valid."""
23+
def setUp(self):
24+
globals = {}
25+
locals = {}
26+
execfile("data/model_data.py", globals, locals)
27+
self.data = locals['DEVICE_MODEL_DATA']
28+
29+
def test_DeviceModelData(self):
30+
# Because there may not be model data present, we just check the type
31+
self.assertEqual(type(self.data), dict)
32+
33+
34+
if __name__ == '__main__':
35+
unittest.main()

data/node_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
# along with this program; if not, write to the Free Software
1414
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1515
#
16-
# splitter_data.py
16+
# node_data.py
1717
# Copyright (C) 2012 Simon Newton
18-
# Data for the splitters & distribution units.
18+
# Data for the nodes.
1919

2020
NODE_DATA = {
2121
0x414c: [

0 commit comments

Comments
 (0)