From 4f7804b221165f634d5355c344609175e452b778 Mon Sep 17 00:00:00 2001 From: Marcus Shawcroft Date: Tue, 5 Apr 2016 16:32:01 +0100 Subject: [PATCH] Remove yaml exporter --- tools/export/__init__.py | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/tools/export/__init__.py b/tools/export/__init__.py index efd50d5186..30d7366d1a 100755 --- a/tools/export/__init__.py +++ b/tools/export/__init__.py @@ -17,7 +17,6 @@ limitations under the License. import os, tempfile from os.path import join, exists, basename from shutil import copytree, rmtree, copy -import yaml from tools.utils import mkdir from tools.export import uvision4, codered, gccarm, ds5_5, iar, emblocks, coide, kds, zip, simplicityv3, atmelstudio, sw4stm32 @@ -55,7 +54,7 @@ def online_build_url_resolver(url): def export(project_path, project_name, ide, target, destination='/tmp/', - tempdir=None, clean=True, extra_symbols=None, build_url_resolver=online_build_url_resolver): + tempdir=None, clean=True, extra_symbols=None, zip=True, build_url_resolver=online_build_url_resolver): # Convention: we are using capitals for toolchain and target names if target is not None: target = target.upper() @@ -109,30 +108,16 @@ def export(project_path, project_name, ide, target, destination='/tmp/', zip_path = None if report['success']: - # readme.txt to contain more exported data - exporter_yaml = { - 'project_generator': { - 'active' : False, - } - } - if use_progen: - try: - import pkg_resources - version = pkg_resources.get_distribution('project_generator').version - exporter_yaml['project_generator']['version'] = version - exporter_yaml['project_generator']['active'] = True; - exporter_yaml['project_generator_definitions'] = {} - version = pkg_resources.get_distribution('project_generator_definitions').version - exporter_yaml['project_generator_definitions']['version'] = version - except ImportError: - pass - with open(os.path.join(tempdir, 'exporter.yaml'), 'w') as outfile: - yaml.dump(exporter_yaml, outfile, default_flow_style=False) # add readme file to every offline export. open(os.path.join(tempdir, 'GettingStarted.htm'),'w').write(''% (ide)) # copy .hgignore file to exported direcotry as well. - copy(os.path.join(exporter.TEMPLATE_DIR,'.hgignore'),tempdir) - zip_path = zip_working_directory_and_clean_up(tempdir, destination, project_name, clean) + if exists(os.path.join(exporter.TEMPLATE_DIR,'.hgignore')): + copy(os.path.join(exporter.TEMPLATE_DIR,'.hgignore'),tempdir) + + if zip: + zip_path = zip_working_directory_and_clean_up(tempdir, destination, project_name, clean) + else: + zip_path = destination return zip_path, report