diff --git a/cpAdmin b/cpAdmin new file mode 100755 index 0000000000000000000000000000000000000000..029a21388dcdb7824c94388e184f484e85cf40b0 --- /dev/null +++ b/cpAdmin @@ -0,0 +1,153 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" + NAME + cpAdmin -- copy the web2py admin file in the current application + + SYNOPSIS + cpAdmin [options] + + DESCRIPTION + Copy or remove the web2py admin file in the current application. + Usefull to fix some problem with the database + + + EXAMPLES + + > cpAdmin -h + > cpAdmin + > cpAdmin --clean + + AUTHOR + R. Le Gac, renaud.legac@free.fr + + Copyright (c) 2012 R. Le Gac + +""" +import os +import shutil +import sys + +DIRS = ['static/css', + 'static/images', + 'static/js'] + +FILES = ['controllers/appadmin.py', + 'static/css/anytime.css', + 'static/css/base.css', + 'static/css/handheld.css', + 'static/css/superfish-navbar.css', + 'static/css/superfish-vertical.css', + 'static/css/superfish.css', + 'static/images/arrows-ffffff.png', + 'static/images/css3buttons_backgrounds.png', + 'static/images/css3buttons_icons.png', + 'static/images/poweredby.png', + 'static/images/shadow.png', + 'static/images/ui-icons_222222_256x240.png', + 'static/js/anytime.js', + 'static/js/dd_belatedpng.js', + 'static/js/jquery.js', + 'static/js/modernizr-1.7.min.js', + 'static/js/superfish.js', + 'static/js/web2py_ajax.js', + 'static/favicon.ico', + 'static/favicon.png', + 'views/appadmin.html', + 'views/generic.html', + 'views/generic.json', + 'views/generic.jsonp', + 'views/generic.load', + 'views/generic.pdf', + 'views/generic.rss', + 'views/generic.xml', + 'views/layout.html', + 'views/web2py_ajax.html',] + +def check(): + """check that the reference application is there. + + """ + path = os.path.join(opt.web2py, opt.refapp) + if not os.path.exists(path): + print "\n\tThe reference web2py application foo is missing" + print "\tUse the option -w to specified another ones.\n" + sys.exit(0) + +def clean(): + """clean admin files. + + """ + # remove individual files + for path in FILES: + if os.path.exists(path): + print "\removing", path + os.remove(path) + + # remove empty directories + for path in DIRS: + try: + print"\tremoving", path + os.rmdir(path) + except: + pass + +def copy(): + """copy admin files in the current applications + + """ + # create directories + for path in DIRS: + if not os.path.exists(path): + print "\tcreating", path + os.mkdir(path) + + # copy files from reference applications + for dest in FILES: + if not os.path.exists(dest): + src = os.path.join(opt.web2py, opt.refapp, dest) + print "\tcopying", dest + shutil.copy(src, dest) + +if __name__ == '__main__': + + import optparse + + # define script options + ops = optparse.OptionParser() + + ops.add_option("-c", "--clean", + action="store_true", + dest= "clean", + help= "remove admin files and exit.") + + ops.add_option("-r", "--reference-application", + dest= "refapp", + help= "name of the reference applications [%default].") + + ops.add_option("-w", "--web2py", + dest= "web2py", + help= "path to the web2py applications [%default].") + + ops.set_defaults(clean=False, + refapp='foo', + web2py=os.path.expanduser('~/myweb/web2py/applications')) + + (opt, args) = ops.parse_args() + + + # clean the admin file and exit + if opt.clean: + print "removing admin files..." + clean() + print "removing is successful !" + sys.exit(0) + + # check that reference application exists + # copy admin files from the reference application and exit + check() + print "adding admin files..." + copy() + print "adding is successful !" + sys.exit(0) + \ No newline at end of file diff --git a/static/plugin_dbui/CHANGELOG b/static/plugin_dbui/CHANGELOG index 4287c71037ade17c918486efdb155e61381ddeae..d52a9062e8aa964bd5592d2eb26174c46ea82354 100644 --- a/static/plugin_dbui/CHANGELOG +++ b/static/plugin_dbui/CHANGELOG @@ -1,9 +1,11 @@ --------------------------------- CHANGE LOG ---------------------------------- HEAD - -0.4.4 (Jan 2012) - + - consolidate the version 0.4.4 + - Polish code and documentation as well as bug fixed + - improve API for PanelWithUrlSlector configurator + - scritp cpAdmin to add/ remove the web2py admin file + 0.4.4 (Jan 2012) - minor release - script to build and tag a new version of plugin_dbui diff --git a/static/plugin_dbui/src/appbase.js b/static/plugin_dbui/src/appbase.js index 2d1fd7bc0301dcd7866f73c7aae237b883e7a796..fbd05efcc0fdbec29ea07cdc91bd256268565970 100644 --- a/static/plugin_dbui/src/appbase.js +++ b/static/plugin_dbui/src/appbase.js @@ -22,7 +22,7 @@ Ext.namespace('App'); /** * @param {String} App.version version of the library */ -App.version = '0.4.4'; +App.version = '0.4.x'; /** * Helper function mimicking the encode_field function running on the server