mirror of
https://gitlab.com/flectra-community/devops/odoo-2-flectra-converter.git
synced 2025-08-14 14:45:41 +00:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
24c2c1e902 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,5 +1,3 @@
|
||||
/data
|
||||
.idea/
|
||||
__pycache__/
|
||||
flectra/
|
||||
odoo/
|
@@ -8,8 +8,8 @@ if __name__ == "__main__":
|
||||
start_time = time.time()
|
||||
parser = argparse.ArgumentParser(description='Migrate Odoo repositories to Flectra')
|
||||
parser.add_argument('--name', help='Name of Repository')
|
||||
parser.add_argument('--company', default='2BIT AG', help='Name of Company')
|
||||
parser.add_argument('--contributor', default='2BIT AG <info@2bit.ch>', help='Name of Contributor')
|
||||
parser.add_argument('--company', default='Jamotion GmbH', help='Name of Repository')
|
||||
parser.add_argument('--contributor', default='Jamotion <info@jamotion.ch>', help='Name of Repository')
|
||||
parser.add_argument('--src', default='./odoo', help='Path to odoo repository')
|
||||
parser.add_argument('--dest', default='./flectra', help='Path to flectra repository')
|
||||
parser.add_argument('--debug', default=False, action='store_true', help='Loglevel: DEBUG')
|
||||
@@ -40,6 +40,7 @@ if __name__ == "__main__":
|
||||
repo_dst_path = os.path.abspath(args.dest)
|
||||
migrator = RepoMigrator(args.name, repo_src_path, repo_dst_path, args.company, args.contributor)
|
||||
migrator.migrate()
|
||||
migrator.generate_gitlab_ci()
|
||||
|
||||
_logger.info('Module migration finished')
|
||||
_logger.info('Migration took {0} second'.format(time.time() - start_time))
|
||||
|
@@ -5,6 +5,7 @@ import logging
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
from os.path import join as oj
|
||||
from shutil import copytree
|
||||
|
||||
@@ -213,6 +214,7 @@ class ModuleMigrator(object):
|
||||
def migrate(self):
|
||||
_logger.info('Starting migration of module %s', self._module_name)
|
||||
copytree(self._src, self._destination, symlinks=True, ignore_dangling_symlinks=True)
|
||||
subprocess.call(['2to3', '-w', self._destination])
|
||||
for base, odoo_dirs, odoo_files in os.walk(self._destination, topdown=True):
|
||||
odoo_files = [f for f in odoo_files if not f[0] == '.']
|
||||
odoo_dirs[:] = [d for d in odoo_dirs if not d[0] == '.']
|
||||
|
Reference in New Issue
Block a user