Skip to content

Commit

Permalink
* updated release version to 0.18.6
Browse files Browse the repository at this point in the history
* updated build tools to have core files zip naming scheme be based on version information contained in build.number.properties
* added new python library to allow reading java property files, remember to add the library to your PYTHONPATH before executing the python script otherwise the script will fail.

`
  • Loading branch information
techdragon.nguyen@gmail.com committed May 7, 2012
1 parent baf4b3b commit e2a0fef
Show file tree
Hide file tree
Showing 18 changed files with 838 additions and 8 deletions.
2 changes: 1 addition & 1 deletion projects/mtg/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="0185" android:versionName="0.18.5" package="net.wagic.app">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="0186" android:versionName="0.18.6" package="net.wagic.app">
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
Expand Down
17 changes: 15 additions & 2 deletions projects/mtg/bin/Res/createResourceZip.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys
import os
import zipfile
from pyjavaproperties import Properties
from optparse import OptionParser

def createResZipFile(filename):
Expand All @@ -25,15 +26,27 @@ def createResZipFile(filename):
utilities.addFolderToZip(zip_file, 'ai')
zip_file.close()

def getFilename():
p = Properties();
p.load(open('../../build.number.properties'));
minor = p['build.minor'];
major = p['build.major'];
point = p['build.point'];
filename = 'core_' + major + minor + point
return filename



def createStandardResFile():
filename = 'core_0184.zip'
print "Creating Standard Resource File"
filename = getFilename() + '.zip'
createResZipFile( filename )
print >> sys.stderr, 'Created Resource Package for Standard Distribution: {0}'.format( filename)

def createIosResFile():
print 'Preparing Resource Package for iOS'
utilities = ZipUtilities()
filename = 'core_0184_iOS.zip'
filename = getFilename() + '_iOS.zip'
#createResZipFile( filename )
zip_file = zipfile.ZipFile(filename, 'a', zipfile.ZIP_STORED)
zip_file.write("../../iOS/Res/rules/modrules.xml", "rules/modrules.xml", zipfile.ZIP_STORED)
Expand Down
8 changes: 5 additions & 3 deletions projects/mtg/build.number.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build.major = 0
build.minor = 18
build.point = 5
#build.number.properties (normally this file is maintained by build.xml)
#Sun, 06 May 2012 11:56:35 -0700
build.major=0
build.minor=18
build.point=6
4 changes: 4 additions & 0 deletions projects/mtg/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
<echo file="${basedir}/include/Wagic_Version.h" >
/*
This file was auto-generated by ant build script on ${TODAY}
To make changes please edit the ant build script, otherwise your changes will be lost

Author: Michael Nguyen

*/

#ifndef wagic_Wagic_Version_h
Expand Down
8 changes: 6 additions & 2 deletions projects/mtg/include/Wagic_Version.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

/*
This file was auto-generated by ant build script on Fri, 20-Apr-2012 00::54:16
This file was auto-generated by ant build script on Sun, 06-May-2012 11::58:10
To make changes please edit the ant build script, otherwise your changes will be lost
Author: Michael Nguyen
*/

#ifndef wagic_Wagic_Version_h
Expand All @@ -9,7 +13,7 @@ This file was auto-generated by ant build script on Fri, 20-Apr-2012 00::54:16
/* Wagic versions */
#define WAGIC_VERSION_MAJOR 0
#define WAGIC_VERSION_MEDIUM 18
#define WAGIC_VERSION_MINOR 5
#define WAGIC_VERSION_MINOR 6

#define VERSION_DOT(a, b, c) a ##.## b ##.## c
#define VERSION_WITHOUT_DOT(a, b, c) a ## b ## c
Expand Down
3 changes: 3 additions & 0 deletions projects/mtg/tools/build/lib/pyjavaproperties-0.6/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include TODO
include README
recursive-include testdata *.properties
109 changes: 109 additions & 0 deletions projects/mtg/tools/build/lib/pyjavaproperties-0.6/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
Metadata-Version: 1.0
Name: pyjavaproperties
Version: 0.6
Summary: Python replacement for java.util.Properties.
Home-page: http://pypi.python.org/pypi/pyjavaproperties
Author: Jesse Noller
Author-email: jnoller@gmail.com
License: PSF License
Description: ================
pyjavaproperties
================

* Project hosting: <http://bitbucket.org/jnoller/pyjavaproperties/>

.. contents::

About
------------------

This is a "fork" of the "python replacement for java.util.Properties" recipe
on ASPN: <http://code.activestate.com/recipes/496795/> and uploaded by
Anand Balachandran Pillai.

The project is maintained by Jesse Noller <jnoller@gmail.com>, Anand Pilla
<abpillai@gmail.com>.

License
------------------
As with all ASPN recipes not otherwise licensed prior to July 15, 2008 on
aspn.activestate.com, the original recipe is under PSF License. For more
information, see the ASPN terms of service here:

<http://code.activestate.com/help/terms/>

While the licensing under the PSF license is sub-optimal, it is what it is. See
<http://docs.python.org/license.html> for more information about the PSF
license.

What this is
------------------
This module is designed to be a python equivalent to the `java.util.Properties <http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html>`_ class.
Currently, the basic input/output methods are supported, and there are plans
to add the XML input/output methods found in J2SE 5.0.

Fundamentally, this module is designed so that users can easily parse and
manipulate Java Properties files - that's it. There's a fair number of us
pythonistas who work in multi-language shops, and constantly writing your own
parsing mechanism is just painful. Not to mention Java guys are notoriously
unwilling to use anything which is cross-language for configuration, unless
it's XML, which is a form of self-punishment. :)

Plans
------------------
Here is a rough plan of features:

- Keep/maintain blank lines and comments found in the original file
- Make the module compatible with the new methods in J2SE 5.0
- Switch to/add python property access rather than direct dictionary get/set
- Add unit tests
- Add unicode support
- When-Pigs-Fly: If running within Jython, switch to java.util.Properties
under the hood
- Coercion/conversion to python types for values

Usage
------------------
This is the easy part::

from pyjavaproperties import Properties
p = Properties()
p.load(open('test2.properties'))
p.list()
print p
print p.items()
print p['name3']
p['name3'] = 'changed = value'
print p['name3']
p['new key'] = 'new value'
p.store(open('test2.properties','w'))

See also the Properties.list() method, which will return an iterator over the
property keys

Changes & News
--------------

0.4:
- Patch from Pepper Lebeck-Jobe for handling ! style comments.

0.3:
- Keys that are added which were not part of the original file
are simply appended to the index. Shenanigans.

0.2:
- Added an internal list (self._keyorder) to keep an ordered index of keys
as they are encountered, so the file can we written-back out in the
same order.

0.1:
- Initial release/fork.
- Added setup/packaging and doc
- added in {foo} style references for previous properties, thanks to N B
on ASPN.
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
96 changes: 96 additions & 0 deletions projects/mtg/tools/build/lib/pyjavaproperties-0.6/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
================
pyjavaproperties
================

* Project hosting: <http://bitbucket.org/jnoller/pyjavaproperties/>

.. contents::

About
------------------

This is a "fork" of the "python replacement for java.util.Properties" recipe
on ASPN: <http://code.activestate.com/recipes/496795/> and uploaded by
Anand Balachandran Pillai.

The project is maintained by Jesse Noller <jnoller@gmail.com>, Anand Pilla
<abpillai@gmail.com>.

License
------------------
As with all ASPN recipes not otherwise licensed prior to July 15, 2008 on
aspn.activestate.com, the original recipe is under PSF License. For more
information, see the ASPN terms of service here:

<http://code.activestate.com/help/terms/>

While the licensing under the PSF license is sub-optimal, it is what it is. See
<http://docs.python.org/license.html> for more information about the PSF
license.

What this is
------------------
This module is designed to be a python equivalent to the `java.util.Properties <http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html>`_ class.
Currently, the basic input/output methods are supported, and there are plans
to add the XML input/output methods found in J2SE 5.0.

Fundamentally, this module is designed so that users can easily parse and
manipulate Java Properties files - that's it. There's a fair number of us
pythonistas who work in multi-language shops, and constantly writing your own
parsing mechanism is just painful. Not to mention Java guys are notoriously
unwilling to use anything which is cross-language for configuration, unless
it's XML, which is a form of self-punishment. :)

Plans
------------------
Here is a rough plan of features:

- Keep/maintain blank lines and comments found in the original file
- Make the module compatible with the new methods in J2SE 5.0
- Switch to/add python property access rather than direct dictionary get/set
- Add unit tests
- Add unicode support
- When-Pigs-Fly: If running within Jython, switch to java.util.Properties
under the hood
- Coercion/conversion to python types for values

Usage
------------------
This is the easy part::

from pyjavaproperties import Properties
p = Properties()
p.load(open('test2.properties'))
p.list()
print p
print p.items()
print p['name3']
p['name3'] = 'changed = value'
print p['name3']
p['new key'] = 'new value'
p.store(open('test2.properties','w'))

See also the Properties.list() method, which will return an iterator over the
property keys

Changes & News
--------------

0.4:
- Patch from Pepper Lebeck-Jobe for handling ! style comments.

0.3:
- Keys that are added which were not part of the original file
are simply appended to the index. Shenanigans.

0.2:
- Added an internal list (self._keyorder) to keep an ordered index of keys
as they are encountered, so the file can we written-back out in the
same order.

0.1:
- Initial release/fork.
- Added setup/packaging and doc
- added in {foo} style references for previous properties, thanks to N B
on ASPN.

5 changes: 5 additions & 0 deletions projects/mtg/tools/build/lib/pyjavaproperties-0.6/TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* Add PEP 8 interface, python properties.
* Add in unit tests
- Have to find some really offensive .properties files
* Switch to returning Unicode values
* Possible coercion to python types (on ints/etc)
Loading

0 comments on commit e2a0fef

Please sign in to comment.