Skip to main content

Candyshop is a helper to determine if all your dependencies are declared properly.

Project description

https://gitcdn.xyz/repo/LuisAlejandro/candyshop/master/docs/_static/banner.svg

An assistant to determine if all your dependencies are declared properly in your odoo module.

PyPI Package Travis CI Coveralls Code Climate Updates Read The Docs Contributor License Agreement Gitter Chat


Candyshop is a helper to determine if all your dependencies are declared properly. A Candyshop is a place where you can pick sweets and candies from a list of wonderful options, but choose wisely.

For more information, please read the full documentation.

Features

  • Access an Odoo Module as an object abstraction.

  • Get all module references from all xml files of a module.

  • Generate and clone the dependency tree of a group of modules (bundle).

  • Generate a virtual enviroment where you can add group of modules.

  • Determine which Odoo Modules declare a dependency to another module that is not present in the environment.

  • Determine which XML files make reference to an Odoo Module that is not present in the environment.

Getting started

Installation

The candyshop program is written in python and hosted on PyPI. Therefore, you can use pip to install the stable version:

$ pip install --upgrade candyshop

If you want to install the development version (not recomended), you can install directlty from GitHub like this:

$ pip install --upgrade https://github.com/LuisAlejandro/candyshop/archive/master.tar.gz

Usage

Here you can consult practical uses for some of the Candyshop functions. For a more detailed review on what you can do with it, we recommend you to read the api documentation.

The Module class

The Module class is an abstraction of an Odoo Module. You can perform several operations to access the module information:

from candyshop.bundle import Module

# Create a Module instance
module = Module('path/to/module')

# Query for data
print(module.path)
print(module.manifest)

# Query information in manifest file
print(module.properties.name)
print(module.properties.version)
print(module.properties.depends)

The Bundle class

The Bundle class is an abstraction of a Group of modules, often referred to as Addons. Here you can see how to interact with a bundle:

from candyshop.bundle import Bundle

# Create a Bundle instance
bundle = Bundle('path/to/bundle')

# Query for data
print(bundle.name)
print(bundle.path)
print(bundle.modules)
print(bundle.oca_dependencies)

The Environment class

The Environment class is an abstraction of a virtual Odoo Environment. Think of it as an imaginary container inside of which you can add Bundles and ask for specific information about them. For example:

from candyshop.environment import Environment

# Create an Environment
env = Environment()

# Insert bundles
# If any bundle has an oca_dependencies.txt file,
# clone its dependencies and insert them as bundles
env.addbundles(['./path-to-bundle', '../addons', '../etc'])

# Make a report about dependencies that are not present in
# the environment
env.get_notmet_dependencies_report()

# Make a report about record ids that reference modules
# which are not present in the environment
env.get_notmet_record_ids_report()

Getting help

If you have any doubts or problems, suscribe to our Gitter Chat and ask for help. You can also ask your question on StackOverflow (tag it pypicontents) or drop me an email at luis@huntingbears.com.ve.

Contributing

See CONTRIBUTING.rst for details.

Release history

See HISTORY.rst for details.

License

Copyright 2016-2017, Candyshop Developers (read AUTHORS.rst for a full list of copyright holders).

Released under a GPL-3 License (read COPYING.rst for license details).

Made with :heart: and :hamburger:

http://huntingbears.com.ve/static/img/site/banner.svg

My name is Luis (@LuisAlejandro) and I’m a Free and Open-Source Software developer living in Maracay, Venezuela.

If you like what I do, please support me on Patreon, Flattr, or donate via PayPal, so that I can continue doing what I love.

Blog huntingbears.com.ve · GitHub @LuisAlejandro · Twitter @LuisAlejandro



Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

candyshop-0.1.4.tar.gz (107.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page