Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Fahrzin Hemmati <fahhem@gmail.com>
Alex Lusco <alusco@google.com>
Simon Ye <sye737+github@gmail.com>
Jamey Hicks <jamey.hicks@gmail.com>
Empty file added adb/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion adb.py → adb/adb_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class AdbCommands(object):
def ConnectDevice(
cls, port_path=None, serial=None, default_timeout_ms=None, **kwargs):
"""Convenience function to get an adb device from usb path or serial.

Args:
port_path: The filename of usb port to use.
serial: The serial number of the device to use.
Expand Down
2 changes: 1 addition & 1 deletion adb_debug.py → adb/adb_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import gflags

import adb
import adb_commands
import common_cli

gflags.ADOPT_module_key_flags(common_cli)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions adb_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import struct
import unittest

import adb
import adb_protocol
from adb import adb_commands
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Google style is probably going to ask you to use import adb instead of using from imports.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, adb_commands is a module, so this is fine. Google style simply says to not import things inside a module, but to import the module itself (for refactoring's sake).

from adb import adb_protocol
import common_stub


Expand Down Expand Up @@ -72,7 +72,7 @@ def _ExpectClose(cls, usb):

@classmethod
def _Connect(cls, usb):
return adb.AdbCommands.Connect(usb, BANNER)
return adb_commands.AdbCommands.Connect(usb, BANNER)


class AdbTest(BaseAdbTest):
Expand All @@ -92,7 +92,7 @@ def testConnect(self):
usb = common_stub.StubUsb()
self._ExpectConnection(usb)

adb.AdbCommands.Connect(usb, BANNER)
adb_commands.AdbCommands.Connect(usb, BANNER)

def testSmallResponseShell(self):
command = 'keepin it real'
Expand Down
2 changes: 1 addition & 1 deletion fastboot_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import gflags

import common_stub
import fastboot
from adb import fastboot

FLAGS = gflags.FLAGS

Expand Down
56 changes: 56 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Copyright 2014 Google Inc. All rights reserved.
#
# 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.

from distutils.core import setup

setup(
name = 'adb',
packages = ['adb'],
version = '1.1.0',
author = 'Fahrzin Hemmati',
author_email = 'fahhem@gmail.com',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're going to publish it to pypi out of the google repo then we should probably use a google contact e-mail and author. If Farz feels strongly we can leave the author as him, there's also a maintainer and maintainer e-mail so at the very least we should set that to a google person. Speaking of which we should add a CONTRIBUTORS file to include farz, simon, myself, and you.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it should include someone actually still on the team. I'm off doing my own thing now, so my interest in this project is more out of nostalgia than actual need 😄 I'm cool with the author being me and the maintainer being whoever wants it.

maintainer = 'alusco@google.com',
maintainer_email = 'Alex Lusco',
url = 'https://github.com/google/python-adb',
description = 'A pure python implementation of the Android ADB and Fastboot protocols',
long_description = '''
This repository contains a pure-python implementation of the Android
ADB and Fastboot protocols, using libusb1 for USB communications.

This is a complete replacement and rearchitecture of the Android
project's ADB and fastboot code available at
https://github.com/android/platform_system_core/tree/master/adb

This code is mainly targeted to users that need to communicate with
Android devices in an automated fashion, such as in automated
testing. It does not have a daemon between the client and the device,
and therefore does not support multiple simultaneous commands to the
same device. It does support any number of devices and never
communicates with a device that it wasn't intended to, unlike the
Android project's ADB.
''',

keywords = ['android', 'adb', 'fastboot'],

requires = ['gflags', 'libusb1', 'M2Crypto'],

## classifier list https://pypi.python.org/pypi?:action=list_classifiers
classifiers = [
'Development Status :: 4 - Beta',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
#'Programming Language :: Python :: 3', ## import cStringIO fails with python3
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, if python3 compatibility was wanted, I'd go with something like six to provide dual compatibility without re-inventing the wheel.

'Topic :: Software Development :: Testing'
]
)