[DEV] Rename maestro as island to be compatible with a free slot in pip

This commit is contained in:
Edouard DUPIN 2017-03-19 22:12:39 +01:00
parent 9973c3b4d6
commit d3a542a957
17 changed files with 112 additions and 112 deletions

View File

@ -1,25 +1,25 @@
Lutin
=====
`maestro` is a generic source downloader and syncronizer is a FREE software tool.
`island` is a generic source downloader and syncronizer is a FREE software tool.
.. image:: https://badge.fury.io/py/maestro.png
:target: https://pypi.python.org/pypi/maestro
.. image:: https://badge.fury.io/py/island.png
:target: https://pypi.python.org/pypi/island
Release (master)
----------------
.. image:: https://travis-ci.org/HeeroYui/maestro.svg?branch=master
:target: https://travis-ci.org/HeeroYui/maestro
.. image:: https://travis-ci.org/HeeroYui/island.svg?branch=master
:target: https://travis-ci.org/HeeroYui/island
Developement (dev)
------------------
.. image:: https://travis-ci.org/HeeroYui/maestro.svg?branch=dev
:target: https://travis-ci.org/HeeroYui/maestro
.. image:: https://travis-ci.org/HeeroYui/island.svg?branch=dev
:target: https://travis-ci.org/HeeroYui/island
Instructions
@ -27,18 +27,18 @@ Instructions
This is a tool to download ```git``` source repositiry in a versatile worktree
Maestro is under a FREE license that can be found in the LICENSE file.
island is under a FREE license that can be found in the LICENSE file.
Any contribution is more than welcome ;)
git repository
--------------
http://github.com/HeeroYui/maestro/
http://github.com/HeeroYui/island/
Documentation
-------------
http://HeeroYui.github.io/maestro/
http://HeeroYui.github.io/island/
Installation
------------
@ -47,7 +47,7 @@ Requirements: ``Python >= 2.7`` and ``pip``
Just run:
pip install maestro
pip install island
Install pip on debian/ubuntu:
@ -65,7 +65,7 @@ Install pip on MacOs:
License (MPL v2.0)
---------------------
Copyright maestro Edouard DUPIN
Copyright island Edouard DUPIN
Licensed under the Mozilla Public License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -8,4 +8,4 @@
## @license MPL v2.0 (see license file)
##
import maestro
import island

View File

@ -32,13 +32,13 @@ def filter_name_and_file(root, list_files, filter):
def import_path_local(path):
out = []
debug.verbose("maestro files: " + str(path) + " [START]")
debug.verbose("island files: " + str(path) + " [START]")
list_files = os.listdir(path)
# filter elements:
tmp_list_maestro_file = filter_name_and_file(path, list_files, env.get_system_base_name() + "*.py")
debug.verbose("maestro files: " + str(path) + " : " + str(tmp_list_maestro_file))
tmp_list_island_file = filter_name_and_file(path, list_files, env.get_system_base_name() + "*.py")
debug.verbose("island files: " + str(path) + " : " + str(tmp_list_island_file))
# Import the module:
for filename in tmp_list_maestro_file:
for filename in tmp_list_island_file:
out.append(os.path.join(path, filename))
debug.verbose(" Find a file : '" + str(out[-1]) + "'")
return out
@ -48,14 +48,14 @@ def init():
global is_init;
if is_init == True:
return
list_of_maestro_files = import_path_local(os.path.join(tools.get_current_path(__file__), 'actions'))
list_of_island_files = import_path_local(os.path.join(tools.get_current_path(__file__), 'actions'))
actions.init(list_of_maestro_files)
actions.init(list_of_island_files)
is_init = True
myArgs = arguments.maestroArg()
myArgs = arguments.islandArg()
myArgs.add_section("option", "Can be set one time in all case")
myArgs.add("h", "help", desc="Display this help")
myArgs.add("v", "verbose", list=[["0","None"],["1","error"],["2","warning"],["3","info"],["4","debug"],["5","verbose"],["6","extreme_verbose"]], desc="display debug level (verbose) default =2")
@ -85,7 +85,7 @@ def usage():
print(" " + color['green'] + elem + color['default'])
"""
print(" " + color['green'] + "init" + color['default'])
print(" initialize a 'maestro' interface with a manifest in a git ")
print(" initialize a 'island' interface with a manifest in a git ")
print(" " + color['green'] + "sync" + color['default'])
print(" Syncronise the currect environement")
print(" " + color['green'] + "status" + color['default'])
@ -134,8 +134,8 @@ def parseGenericArg(argument, active):
return False
"""
# open configuration of maestro:
config_file_name = "maestroConfig.py"
# open configuration of island:
config_file_name = "islandConfig.py"
config_file = os.path.join(tools.get_run_path(), config_file_name)
if os.path.isfile(config_file) == True:
sys.path.append(os.path.dirname(config_file))
@ -221,7 +221,7 @@ if action_to_do not in list_actions:
# todo : Remove this
if action_to_do != "init" \
and os.path.exists("." + env.get_system_base_name()) == False:
debug.error("Can not execute a maestro cmd if we have not initialize a config: '" + str("." + env.get_system_base_name()) + "'")
debug.error("Can not execute a island cmd if we have not initialize a config: '" + str("." + env.get_system_base_name()) + "'")
exit(-1)

View File

@ -20,7 +20,7 @@ __base_action_name = env.get_system_base_name() + "Action_"
def init(files):
global list_actions;
debug.debug("List of action for maestro: ")
debug.debug("List of action for island: ")
for elem_path in files :
base_name = os.path.basename(elem_path)
if len(base_name) <= 3 + len(__base_action_name):

View File

@ -8,10 +8,10 @@
## @license MPL v2.0 (see license file)
##
from maestro import debug
from maestro import tools
from maestro import env
from maestro import multiprocess
from island import debug
from island import tools
from island import env
from island import multiprocess
import os
def help():
@ -49,19 +49,19 @@ def execute(arguments):
# check if .XXX exist (create it if needed)
if os.path.exists(env.get_maestro_path()) == True \
and os.path.exists(env.get_maestro_path_config()) == True \
and os.path.exists(env.get_maestro_path_manifest()) == True:
debug.error("System already init: path already exist: '" + str(env.get_maestro_path()) + "'")
tools.create_directory(env.get_maestro_path())
if os.path.exists(env.get_island_path()) == True \
and os.path.exists(env.get_island_path_config()) == True \
and os.path.exists(env.get_island_path_manifest()) == True:
debug.error("System already init: path already exist: '" + str(env.get_island_path()) + "'")
tools.create_directory(env.get_island_path())
# check if the git of the manifest if availlable
# create the file configuration:
data = "repo=" + address_manifest + "\nbranch=" + branch + "\nfile=" + manifest_name
tools.file_write_data(env.get_maestro_path_config(), data)
tools.file_write_data(env.get_island_path_config(), data)
#clone the manifest repository
cmd = "git clone " + address_manifest + " --branch " + branch + " " + env.get_maestro_path_manifest()
cmd = "git clone " + address_manifest + " --branch " + branch + " " + env.get_island_path_manifest()
debug.info("clone the manifest")
ret = multiprocess.run_command_direct(cmd)

View File

@ -8,11 +8,11 @@
## @license MPL v2.0 (see license file)
##
from maestro import debug
from maestro import tools
from maestro import env
from maestro import multiprocess
from maestro import manifest
from island import debug
from island import tools
from island import env
from island import multiprocess
from island import manifest
import os
@ -31,20 +31,20 @@ def execute(arguments):
debug.error("Sync have not parameter")
# check if .XXX exist (create it if needed)
if os.path.exists(env.get_maestro_path()) == False \
or os.path.exists(env.get_maestro_path_config()) == False \
or os.path.exists(env.get_maestro_path_manifest()) == False:
debug.error("System already init have an error: missing data: '" + str(env.get_maestro_path()) + "'")
if os.path.exists(env.get_island_path()) == False \
or os.path.exists(env.get_island_path_config()) == False \
or os.path.exists(env.get_island_path_manifest()) == False:
debug.error("System already init have an error: missing data: '" + str(env.get_island_path()) + "'")
configuration = manifest.load_config()
debug.info("update manifest : '" + str(env.get_maestro_path_manifest()) + "'")
debug.info("update manifest : '" + str(env.get_island_path_manifest()) + "'")
# update manifest
cmd = "git fetch --all"
multiprocess.run_command_direct(cmd, cwd=env.get_maestro_path_manifest())
multiprocess.run_command_direct(cmd, cwd=env.get_island_path_manifest())
file_source_manifest = os.path.join(env.get_maestro_path_manifest(), configuration["file"])
file_source_manifest = os.path.join(env.get_island_path_manifest(), configuration["file"])
if os.path.exists(file_source_manifest) == False:
debug.error("Missing manifest file : '" + str(file_source_manifest) + "'")
@ -57,7 +57,7 @@ def execute(arguments):
id_element += 1
debug.info("sync : " + str(id_element) + "/" + str(len(all_project)) + " : " + str(elem.name))
#debug.debug("elem : " + str(elem))
git_repo_path = os.path.join(env.get_maestro_root_path(), elem.path)
git_repo_path = os.path.join(env.get_island_root_path(), elem.path)
if os.path.exists(git_repo_path) == False:
# this is a new clone ==> this is easy ...
#clone the manifest repository

View File

@ -218,7 +218,7 @@ class ArgSection:
##
## @brief Class to define the agmument list availlable for a program
##
class maestroArg:
class islandArg:
##
## @brief Constructor.
## @param[in] self Class handle

55
island/env.py Normal file
View File

@ -0,0 +1,55 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
# Local import
from . import debug
import os
system_base_name = "island"
def set_system_base_name(val):
global system_base_name
system_base_name = val
debug.debug("Set basename: '" + str(system_base_name) + "'")
def get_system_base_name():
global system_base_name
return system_base_name
island_root_path = os.path.join(os.getcwd())
island_path = os.path.join(island_root_path, "." + get_system_base_name())
island_path_config = os.path.join(island_path, "config.txt")
island_path_manifest = os.path.join(island_path, "manifest")
##
## @brief to use later to know where the ".island" parent path is ...
## @return the parent path of the ".island"
##
def get_island_root_path():
global island_root_path
return island_root_path
def get_island_path():
global island_path
return island_path
def get_island_path_config():
global island_path_config
return island_path_config
def get_island_path_manifest():
global island_path_manifest
return island_path_manifest

View File

@ -20,7 +20,7 @@ from lxml import etree
def load_config():
config_property = tools.file_read_data(env.get_maestro_path_config())
config_property = tools.file_read_data(env.get_island_path_config())
element_config = config_property.split("\n")
if len(element_config) != 3:
debug.error("error in configuration property")

View File

@ -1,55 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
# Local import
from . import debug
import os
system_base_name = "maestro"
def set_system_base_name(val):
global system_base_name
system_base_name = val
debug.debug("Set basename: '" + str(system_base_name) + "'")
def get_system_base_name():
global system_base_name
return system_base_name
maestro_root_path = os.path.join(os.getcwd())
maestro_path = os.path.join(maestro_root_path, "." + get_system_base_name())
maestro_path_config = os.path.join(maestro_path, "config.txt")
maestro_path_manifest = os.path.join(maestro_path, "manifest")
##
## @brief to use later to know where the ".maestro" parent path is ...
## @return the parent path of the ".maestro"
##
def get_maestro_root_path():
global maestro_root_path
return maestro_root_path
def get_maestro_path():
global maestro_path
return maestro_path
def get_maestro_path_config():
global maestro_path_config
return maestro_path_config
def get_maestro_path_manifest():
global maestro_path_manifest
return maestro_path_manifest

View File

@ -15,16 +15,16 @@ def readme():
return f.read()
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
setup(name='maestro',
setup(name='island',
version='0.1.0',
description='Maestro generic source manager (like repo in simple mode)',
description='island generic source manager (like repo in simple mode)',
long_description=readme(),
url='http://github.com/HeeroYui/maestro',
url='http://github.com/HeeroYui/island',
author='Edouard DUPIN',
author_email='yui.heero@gmail.com',
license='MPL-2',
packages=['maestro',
'maestro/actions'],
packages=['island',
'island/actions'],
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
@ -32,7 +32,7 @@ setup(name='maestro',
'Topic :: Software Development :: Build Tools'
],
keywords='source manager repo qisrc lutin',
scripts=['bin/maestro'],
scripts=['bin/island'],
# Does not work on MacOs
#data_file=[
# ('/etc/bash_completion.d', ['bash-autocompletion/lutin']),