Remove yaml exporter

Marcus Shawcroft 2016-04-05 16:32:01 +01:00
parent 3b2b06197a
commit 4f7804b221
1 changed files with 8 additions and 23 deletions

View File

@ -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('<meta http-equiv="refresh" content="0; url=http://mbed.org/handbook/Getting-Started-mbed-Exporters#%s"/>'% (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