-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6c5f97c
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import json, os | ||
from optparse import OptionParser | ||
|
||
ACTIONS = ['install', 'debug', 'package', 'deploy', 'log'] | ||
|
||
|
||
def parse_appinfo(dest_dir): | ||
"""Reads the content of the appinfo file and | ||
decodes the json""" | ||
content = open(os.path.join(dest_dir, "appinfo.json")).read() | ||
appinfo = json.loads(content) | ||
return appinfo | ||
|
||
def package(dest_dir): | ||
""" Packages the application""" | ||
pass | ||
|
||
def install(dest_dir, appinfo, version=None): | ||
""" Installs version number xxx to the device""" | ||
pass | ||
|
||
|
||
|
||
def main_func(): | ||
|
||
usage = """usage: %prog [options] action | ||
Use PyPalm to control your development process on the webOS device. | ||
install - installs the current version of the app on the device | ||
package - package the current version | ||
deploy - package and deploy | ||
debug - start the debugger | ||
log - get log output from the device""" | ||
parser = OptionParser(usage) | ||
parser.add_option("-d", "--device", dest='device', | ||
help="Target device: [tcp|usb]", default="tcp") | ||
|
||
(options, args) = parser.parse_args() | ||
|
||
# Get the action arg | ||
if len(args) == 0: | ||
parser.print_help() | ||
exit() | ||
|
||
if not args[0] in ACTIONS: | ||
parser.error("%s must be one of: %s" % (args[0], ", ".join(ACTIONS))) | ||
|
||
# We always assume this dir | ||
current_dir = os.getcwd() | ||
app_info = parse_appinfo(current_dir) | ||
|
||
print app_info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from setuptools import setup, find_packages | ||
|
||
setup( | ||
name = "PyPalm", | ||
version = "0.1", | ||
packages = find_packages(), | ||
|
||
author = "Martin Grund", | ||
author_email = "grundprinzip@gmail.com", | ||
description = "PyPalm should ease handling the development of Palm WebOs applications", | ||
|
||
entry_points = { | ||
'console_scripts': [ | ||
'pypalm = pypalm.pypalm:main_func', | ||
] | ||
}, | ||
|
||
) |