Code Monkey home page Code Monkey logo

adi.devgen's Introduction

Introduction

Yet another command-line Plone-Add-On-Generator.

This package doesn't have any dependencies, so all ever possible occuring problems can safely be attributed to itself.

Additionally it was desirable to be able to execute any Plone-addon-extending command of within any location of an addon. Or, of outside of an addon, by prepending the path to the addon to the command, so one doesn't necessarily need to change directories and executing a command doesn't require you to be in a certain directory.

Besides of Plone-addon-related helper-functions, there are also functions more general related to developing, like doOnRemote(), getRepos(), squash(), and so on.

Setting up a new Plone-instance is as easy as addPlone(), will download the configs for buildout locally and set buildout's mode to 'offline', so we save time, whenever running buildout, because it will not look up the configs of remote addresses, like usually, as time is honey.

DISCLAIMER: The usual formatting of Plone-configs have changed, addPlone() works testedly up to Plone vs. 4.3.4, needs to be fixed for getting newer versions.

Installation

Using pip

If you have pip installed, you can simply do:

pip install adi.devgen

If you want to dabble with bleeding edge development version, do:

pip install -e git+https://github.com/ida/adi.devgen.git#egg=adi.devgen

In the latter case this package will be added to a directory (a.k.a. folder) called 'src', which lives, where your pip lives. To find out where your pip lives, type which pip into your console. You can then change the code in the src-directory and get the effects immediately.

Using buildout

In your buildout-config eggs-section, add adi.devgen, run buildout. The exececutable then lives in your instance's bin-directory and can used like this: ./bin/devgen.

If you chose this install-method, prefix all following examples with ./bin/.

Configuration / Presettings

When creating a new addon and a file '~/.buildout/devgen.cfg' is present, values will be read of it and inserted into the setup.py of the addon. The file-contents' format must be like this:

author=Arbi Trary

[email protected]

url=https://github.com/arbitrary/your.addon

Usage

Type the command and 'help', to get a verbose description fo this tool:

devgen help

Type the command alone, to get a list of the available generator-functions:

devgen

Or, have a look into the methods of adi.devgen.scripts.skel.addSkel, all of those are available of the commandline, when prepending 'devgen'.

To get a choosen function's help-text, to see what arguments it expects, type:

devgen [FUNCTION_NAME] help

Examples

Create boilerplate for an addon, that can do nothing, but be installed in a Plonesite:

devgen addProfile your.addon

Create it not in the directory, where you are, but somewhere else:

devgen addProfile some/where/else/your.addon

Register another addon as a dependency to your addon:

devgen addDep collective.bestaddonever some/where/your.addon

Or, first locate into your addon, then you can omit the appended path:

cd your.addon
devgen addDep collective.bestaddonever

By the way, most commands work of within any location inside of an addon and no need to pass a path.

Register and add a browser-based stylesheet named 'main.css' in 'your.addon/your/addon/browser/resources':

devgen addCss

Register and add a browser-based Javascript named 'magic.js' in 'your.addon/your/addon/browser/resources':

devgen addJS magic

Register and add a browser-based Template named 'main.pt' and a Python-script named 'main.py' with an example how to retrieve a computed value of the script in the template via TAL, in: 'your.addon/your/addon/browser/resources':

devgen addView

The view can then be called in a browser like this:

http://localhost:8080/Plone/++resource++your.addon.resources/your_addon_main_view

Where 'main' is the default name for the files, you can choose any other:

devgen addView any_other

That'll result to:

http://localhost:8080/Plone/++resource++your.addon.resources/your_addon_any_other_view

TODO

  • Regard more than one-dotted-namespace for addon.
  • Possibly transfer:

https://github.com/ida/skriptz/blob/master/plone/Dexterity/addField.py

adi.devgen's People

Contributors

bitdeli-chef avatar

Stargazers

 avatar

Watchers

 avatar  avatar

adi.devgen's Issues

addMetaSkel(): missing README-gen

also: do addMetaSkel on any standard-addon (addProfileSkel, addBrowserSkel, addSkinSkel, ...)
!: dosen't regard current location, expects addon-root, change that

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.