Skip to content

Commit

Permalink
* initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
grundprinzip committed Dec 15, 2009
0 parents commit 6c5f97c
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
Empty file added pypalm/__init__.py
Empty file.
53 changes: 53 additions & 0 deletions pypalm/pypalm.py
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
18 changes: 18 additions & 0 deletions setup.py
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',
]
},

)

0 comments on commit 6c5f97c

Please sign in to comment.