summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Shan <shanyu@google.com>2017-10-09 10:53:53 -0700
committerYu Shan <shanyu@google.com>2017-10-09 11:31:45 -0700
commit765bee384462e4f64740c5aadfccbf52348b68da (patch)
treef5a994b557726909ab1460ee1e2ccdf8f033c122
parent2b6004bccb8a19681387f3ac415b481e7fe27acc (diff)
downloadattestation-765bee384462e4f64740c5aadfccbf52348b68da.tar.gz
Add license information for Android Things Factory Tool.
License is Apache 2.0. Change-Id: I68c70d74c6ca25b3ae042a217f55b5ab0ba7e8af
-rw-r--r--at-factory-tool/atft.py14
-rw-r--r--at-factory-tool/atft_unittest.py29
-rw-r--r--at-factory-tool/atftman.py14
-rw-r--r--at-factory-tool/atftman_unittest.py14
-rw-r--r--at-factory-tool/fastboot_exceptions.py19
-rw-r--r--at-factory-tool/fastbootsh.py19
-rw-r--r--at-factory-tool/fastbootsh_unittest.py14
-rw-r--r--at-factory-tool/fastbootsubp.py18
-rw-r--r--at-factory-tool/fastbootsubp_unittest.py16
-rw-r--r--at-factory-tool/serialmapperlinux.py19
-rw-r--r--at-factory-tool/serialmapperwin.py18
11 files changed, 168 insertions, 26 deletions
diff --git a/at-factory-tool/atft.py b/at-factory-tool/atft.py
index aa5f854..6c4ce8a 100644
--- a/at-factory-tool/atft.py
+++ b/at-factory-tool/atft.py
@@ -1,4 +1,18 @@
#!/usr/bin/python
+# Copyright 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
"""Graphical tool for managing the ATFA and AT communication.
This tool allows for easy graphical access to common ATFA commands. It also
diff --git a/at-factory-tool/atft_unittest.py b/at-factory-tool/atft_unittest.py
index 21751e4..876f875 100644
--- a/at-factory-tool/atft_unittest.py
+++ b/at-factory-tool/atft_unittest.py
@@ -1,13 +1,25 @@
+# Copyright 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
"""Unit test for atft."""
import unittest
import atft
-
from atftman import ProvisionStatus
import fastboot_exceptions
from mock import call
from mock import MagicMock
-import fastboot_exceptions
from mock import patch
import wx
@@ -78,21 +90,19 @@ class AtftTest(unittest.TestCase):
mock_atft.PrintToWindow = MagicMock()
mock_atft._HandleKeysLeft = MagicMock()
mock_atft.target_devs_output.Append.side_effect = self.AppendTargetDevice
- (mock_atft.target_devs_output.
- DeleteAllItems.side_effect) = self.DeleteAllItems
+ (mock_atft.target_devs_output.DeleteAllItems.side_effect
+ ) = self.DeleteAllItems
mock_atft.atft_manager.target_devs = []
mock_atft._DeviceListedEventHandler(None)
mock_atft.atft_manager.target_devs = [self.test_dev1]
mock_atft._DeviceListedEventHandler(None)
mock_atft.target_devs_output.Append.assert_called_once()
self.assertEqual(1, len(self.test_target_devs))
- self.assertEqual(self.test_dev1.serial_number,
- self.test_target_devs[0][0])
+ self.assertEqual(self.test_dev1.serial_number, self.test_target_devs[0][0])
mock_atft.atft_manager.target_devs = [self.test_dev1, self.test_dev2]
mock_atft._DeviceListedEventHandler(None)
self.assertEqual(2, len(self.test_target_devs))
- self.assertEqual(self.test_dev2.serial_number,
- self.test_target_devs[1][0])
+ self.assertEqual(self.test_dev2.serial_number, self.test_target_devs[1][0])
mock_atft.atft_manager.target_devs = [self.test_dev1, self.test_dev2]
mock_atft.target_devs_output.Append.reset_mock()
mock_atft._DeviceListedEventHandler(None)
@@ -105,8 +115,7 @@ class AtftTest(unittest.TestCase):
mock_atft.atft_manager.target_devs = [self.test_dev2]
mock_atft._DeviceListedEventHandler(None)
self.assertEqual(1, len(self.test_target_devs))
- self.assertEqual(self.test_dev2.serial_number,
- self.test_target_devs[0][0])
+ self.assertEqual(self.test_dev2.serial_number, self.test_target_devs[0][0])
mock_atft.atft_manager.target_devs = []
mock_atft._DeviceListedEventHandler(None)
self.assertEqual(0, len(self.test_target_devs))
diff --git a/at-factory-tool/atftman.py b/at-factory-tool/atftman.py
index 84a3e59..3558b70 100644
--- a/at-factory-tool/atftman.py
+++ b/at-factory-tool/atftman.py
@@ -1,4 +1,18 @@
#!/usr/bin/python
+# Copyright 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
"""AT-Factory-Tool manager module.
This module provides the logical implementation of the graphical tool for
diff --git a/at-factory-tool/atftman_unittest.py b/at-factory-tool/atftman_unittest.py
index 2200eb7..e2a0fc7 100644
--- a/at-factory-tool/atftman_unittest.py
+++ b/at-factory-tool/atftman_unittest.py
@@ -1,3 +1,17 @@
+# Copyright 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
"""Unit test for atft manager."""
import base64
import unittest
diff --git a/at-factory-tool/fastboot_exceptions.py b/at-factory-tool/fastboot_exceptions.py
index f6eb6ec..978920b 100644
--- a/at-factory-tool/fastboot_exceptions.py
+++ b/at-factory-tool/fastboot_exceptions.py
@@ -1,6 +1,19 @@
-#!/usr/bin/python
-"""Exceptions for At-Factory-Tool Manager (atftman).
-"""
+# !/usr/bin/python
+# Copyright 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Exceptions for At-Factory-Tool Manager (atftman)."""
class DeviceNotFoundException(Exception):
diff --git a/at-factory-tool/fastbootsh.py b/at-factory-tool/fastbootsh.py
index 5b6dc11..593e9f1 100644
--- a/at-factory-tool/fastbootsh.py
+++ b/at-factory-tool/fastbootsh.py
@@ -1,7 +1,20 @@
# !/usr/bin/python
-"""Fastboot Interface Implementation using sh library.
-
-"""
+# Copyright 2017 Google Inc. All Rights Reserved.
+# Author: shanyu@google.com (Yu Shan)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Fastboot Interface Implementation using sh library."""
import os
import sys
import threading
diff --git a/at-factory-tool/fastbootsh_unittest.py b/at-factory-tool/fastbootsh_unittest.py
index 562f38c..edd0058 100644
--- a/at-factory-tool/fastbootsh_unittest.py
+++ b/at-factory-tool/fastbootsh_unittest.py
@@ -1,3 +1,17 @@
+# Copyright 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
"""Unit test for fastboot interface using sh library."""
import unittest
diff --git a/at-factory-tool/fastbootsubp.py b/at-factory-tool/fastbootsubp.py
index 9fa5ab6..786ea2d 100644
--- a/at-factory-tool/fastbootsubp.py
+++ b/at-factory-tool/fastbootsubp.py
@@ -1,7 +1,19 @@
# !/usr/bin/python
-"""Fastboot Interface Implementation using subprocess library.
-
-"""
+# Copyright 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Fastboot Interface Implementation using subprocess library."""
import os
import subprocess
import sys
diff --git a/at-factory-tool/fastbootsubp_unittest.py b/at-factory-tool/fastbootsubp_unittest.py
index 49c8ea6..d966bda 100644
--- a/at-factory-tool/fastbootsubp_unittest.py
+++ b/at-factory-tool/fastbootsubp_unittest.py
@@ -1,6 +1,20 @@
+# Copyright 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
"""Unit test for fastboot interface using subprocess library."""
-import unittest
import subprocess
+import unittest
import fastboot_exceptions
import fastbootsubp
diff --git a/at-factory-tool/serialmapperlinux.py b/at-factory-tool/serialmapperlinux.py
index c7246fb..7407338 100644
--- a/at-factory-tool/serialmapperlinux.py
+++ b/at-factory-tool/serialmapperlinux.py
@@ -1,7 +1,18 @@
-"""This module provides the serial number to USB location map on Linux.
-
-It uses sysfs information.
-"""
+# Copyright 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""This module provides the serial number to USB location map on Linux."""
import os
diff --git a/at-factory-tool/serialmapperwin.py b/at-factory-tool/serialmapperwin.py
index 2fcec63..d902974 100644
--- a/at-factory-tool/serialmapperwin.py
+++ b/at-factory-tool/serialmapperwin.py
@@ -1,7 +1,21 @@
+# Copyright 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
"""This module provides the USB device serial number to USB location map on Win.
-It uses Windows APIs to get USB device information. Ctypes are used to support
-calling C type functions.
+This module uses Windows APIs to get USB device information. Ctypes are used to
+support calling C type functions.
"""
# pylint: disable=invalid-name
import ctypes