Skip to content

Commit 189f22d

Browse files
committed
Basic module structure
0 parents  commit 189f22d

9 files changed

Lines changed: 93 additions & 0 deletions

File tree

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.DS_Store
2+
3+
*~
4+
*#
5+
*._*
6+
*.log
7+
*.log.*
8+
9+
*.pyc
10+
11+
build

LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2012-2014 Appium Committers
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Appium Python Client
2+
====================
3+
4+
An extension library for adding [Selenium 3.0 draft](https://code.google.com/p/selenium/source/browse/spec-draft.md?repo=mobile) functionality to [Appium](https://github.com/appium/appium).
5+
6+

appium/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

appium/mobilecommand.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class MobileCommand(object):
2+
CONTEXTS = 'contexts'

appium/webdriver/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from webdriver import WebDriver as Remote

appium/webdriver/webdriver.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/python
2+
3+
from selenium import webdriver
4+
5+
class WebDriver(webdriver.Remote):
6+
def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
7+
desired_capabilities=None, browser_profile=None, proxy=None, keep_alive=False):
8+
9+
# we have no new initialization to do
10+
super(WebDriver, self).__init__(command_executor, desired_capabilities, browser_profile, proxy, keep_alive)

docs/roadmap.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Appium Python Client Plan
2+
=========================
3+
4+
This library will be a simple extension of the official Python bindings, through
5+
subclassing, to add the new methods. I would like to maintain the same package
6+
structure, so that switching to the Appium library would be a matter of changing
7+
the import.
8+
9+
The official client allows for three ways to interact with the server: with the
10+
`selenium` class, with the `webdriver.Remote` class, and with specific browser
11+
classes, which subclass `webdriver.Remote` in `webdriver.*` classes. It seems
12+
like we would not need to update the browser classes for our use case, and the
13+
first is for RC, which we don't support. Thus we can subclass the official
14+
`webdriver.Remote` classes and add the new methods. Otherwise we would need to
15+
use composition, since we have to change the base class and subclasses.
16+
17+
Usage will remain as it currently is, using the first two methods from above,
18+
other than importing from Appium:
19+
20+
```python
21+
from appium import webdriver
22+
23+
desired_caps = {}
24+
# ...
25+
26+
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
27+
28+
print driver.get_window_size()
29+
elem = driver.find_element_by_name('Graphics')
30+
elem.click()
31+
driver.quit()
32+
```
33+
34+
As Selenium catches up, the methods can be seemlessly removed from the Appium
35+
client. Any methods outside of the spec can remain and be used without issue,
36+
should the user choose.

setup.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env python
2+
3+
from distutils.core import setup
4+
5+
setup(name='Python-Client',
6+
version='0.1',
7+
description='Appium Python Client',
8+
author='Isaac Murchie',
9+
author_email='[email protected]',
10+
url='http://appium.io/',
11+
packages=['appium', 'appium.webdriver'],
12+
license='Apache 2.0'
13+
)

0 commit comments

Comments
 (0)