[UPD] format script
This commit is contained in:
parent
c1341a4198
commit
12af324e5c
15 changed files with 27 additions and 23 deletions
|
|
@ -4,17 +4,16 @@
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import configparser
|
import configparser
|
||||||
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import uuid
|
import uuid
|
||||||
import json
|
|
||||||
|
|
||||||
from git import Repo
|
from git import Repo
|
||||||
from git.exc import InvalidGitRepositoryError, NoSuchPathError
|
from git.exc import InvalidGitRepositoryError, NoSuchPathError
|
||||||
|
|
||||||
|
|
||||||
CODE_GENERATOR_DIRECTORY = "./addons/TechnoLibre_odoo-code-generator-template/"
|
CODE_GENERATOR_DIRECTORY = "./addons/TechnoLibre_odoo-code-generator-template/"
|
||||||
CODE_GENERATOR_DEMO_NAME = "code_generator_demo"
|
CODE_GENERATOR_DEMO_NAME = "code_generator_demo"
|
||||||
KEY_REPLACE_CODE_GENERATOR_DEMO = 'MODULE_NAME = "%s"'
|
KEY_REPLACE_CODE_GENERATOR_DEMO = 'MODULE_NAME = "%s"'
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,15 @@
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
import astor
|
|
||||||
import json
|
|
||||||
import ast
|
import ast
|
||||||
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
import astor
|
||||||
|
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import argparse
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from colorama import Fore, Style
|
from colorama import Fore, Style
|
||||||
|
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import uuid
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import uuid
|
||||||
|
|
||||||
from code_writer import CodeWriter
|
from code_writer import CodeWriter
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@ import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from xml.dom import Node, minidom
|
from xml.dom import Node, minidom
|
||||||
from colorama import Fore, Style
|
|
||||||
|
|
||||||
from code_writer import CodeWriter
|
from code_writer import CodeWriter
|
||||||
|
from colorama import Fore, Style
|
||||||
|
|
||||||
from script.git.git_tool import GitTool
|
from script.git.git_tool import GitTool
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,14 @@
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from collections import defaultdict
|
|
||||||
import uuid
|
|
||||||
import time
|
|
||||||
import json
|
|
||||||
import sys
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
import uuid
|
||||||
|
from collections import defaultdict
|
||||||
|
|
||||||
logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO"))
|
logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO"))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@ from __future__ import print_function
|
||||||
import argparse
|
import argparse
|
||||||
import os.path
|
import os.path
|
||||||
import shutil
|
import shutil
|
||||||
from colorama import Fore, Style
|
|
||||||
|
|
||||||
import yaml # pip install PyYAML
|
import yaml # pip install PyYAML
|
||||||
from agithub.GitHub import GitHub # pip install agithub
|
from agithub.GitHub import GitHub # pip install agithub
|
||||||
|
from colorama import Fore, Style
|
||||||
from git import Repo # pip install gitpython
|
from git import Repo # pip install gitpython
|
||||||
from giturlparse import parse # pip install giturlparse
|
from giturlparse import parse # pip install giturlparse
|
||||||
from retrying import retry # pip install retrying
|
from retrying import retry # pip install retrying
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ import argparse
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from colorama import Fore, Style
|
|
||||||
|
|
||||||
|
from colorama import Fore, Style
|
||||||
from git import Repo
|
from git import Repo
|
||||||
|
|
||||||
new_path = os.path.normpath(
|
new_path = os.path.normpath(
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,11 @@ import os
|
||||||
import webbrowser
|
import webbrowser
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from typing import List
|
from typing import List
|
||||||
from colorama import Fore, Style
|
|
||||||
|
|
||||||
import git
|
import git
|
||||||
import xmltodict
|
import xmltodict
|
||||||
from agithub.GitHub import GitHub # pip install agithub
|
from agithub.GitHub import GitHub # pip install agithub
|
||||||
|
from colorama import Fore, Style
|
||||||
from git import Repo
|
from git import Repo
|
||||||
from giturlparse import parse # pip install giturlparse
|
from giturlparse import parse # pip install giturlparse
|
||||||
from retrying import retry # pip install retrying
|
from retrying import retry # pip install retrying
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,11 @@
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import csv
|
import csv
|
||||||
|
import glob
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import glob
|
|
||||||
|
|
||||||
import xmltodict
|
import xmltodict
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,10 @@ import logging
|
||||||
import os
|
import os
|
||||||
from collections import OrderedDict, defaultdict
|
from collections import OrderedDict, defaultdict
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from colorama import Fore, Style
|
|
||||||
|
|
||||||
import iscompatible
|
import iscompatible
|
||||||
import toml
|
import toml
|
||||||
|
from colorama import Fore, Style
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,12 @@
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import csv
|
||||||
import datetime
|
import datetime
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
import csv
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
from dateutil.relativedelta import relativedelta
|
from dateutil.relativedelta import relativedelta
|
||||||
|
|
|
||||||
|
|
@ -6,15 +6,15 @@ import argparse
|
||||||
import asyncio
|
import asyncio
|
||||||
import configparser
|
import configparser
|
||||||
import datetime
|
import datetime
|
||||||
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import time
|
import time
|
||||||
import uuid
|
import uuid
|
||||||
import json
|
|
||||||
from typing import Tuple
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
from typing import Tuple
|
||||||
|
|
||||||
import aioshutil
|
import aioshutil
|
||||||
import git
|
import git
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import logging
|
|
||||||
import json
|
import json
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
|
|
|
||||||
|
|
@ -469,7 +469,7 @@ class Update:
|
||||||
ADDONS_PATH,
|
ADDONS_PATH,
|
||||||
ADDONS_PATH
|
ADDONS_PATH
|
||||||
+ "_"
|
+ "_"
|
||||||
+ time.strftime('%Yy%mm%dd-%Hh%Mm%Ss'),
|
+ time.strftime("%Yy%mm%dd-%Hh%Mm%Ss"),
|
||||||
)
|
)
|
||||||
os.symlink(addons_path_with_version, ADDONS_PATH)
|
os.symlink(addons_path_with_version, ADDONS_PATH)
|
||||||
return status
|
return status
|
||||||
|
|
@ -701,7 +701,11 @@ def main():
|
||||||
|
|
||||||
_logger.info("Validate environment")
|
_logger.info("Validate environment")
|
||||||
status = 0
|
status = 0
|
||||||
if update.config.install_dev or update.config.partial_install or update.config.is_in_switch:
|
if (
|
||||||
|
update.config.install_dev
|
||||||
|
or update.config.partial_install
|
||||||
|
or update.config.is_in_switch
|
||||||
|
):
|
||||||
status = update.validate_environment()
|
status = update.validate_environment()
|
||||||
if update.config.install:
|
if update.config.install:
|
||||||
status = update.install_system()
|
status = update.install_system()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue