Skip to content

Commit 4f7804b

Browse files
committed
Remove yaml exporter
1 parent 3b2b061 commit 4f7804b

File tree

1 file changed

+8
-23
lines changed

1 file changed

+8
-23
lines changed

tools/export/__init__.py

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import os, tempfile
1818
from os.path import join, exists, basename
1919
from shutil import copytree, rmtree, copy
20-
import yaml
2120

2221
from tools.utils import mkdir
2322
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):
5554

5655

5756
def export(project_path, project_name, ide, target, destination='/tmp/',
58-
tempdir=None, clean=True, extra_symbols=None, build_url_resolver=online_build_url_resolver):
57+
tempdir=None, clean=True, extra_symbols=None, zip=True, build_url_resolver=online_build_url_resolver):
5958
# Convention: we are using capitals for toolchain and target names
6059
if target is not None:
6160
target = target.upper()
@@ -109,30 +108,16 @@ def export(project_path, project_name, ide, target, destination='/tmp/',
109108

110109
zip_path = None
111110
if report['success']:
112-
# readme.txt to contain more exported data
113-
exporter_yaml = {
114-
'project_generator': {
115-
'active' : False,
116-
}
117-
}
118-
if use_progen:
119-
try:
120-
import pkg_resources
121-
version = pkg_resources.get_distribution('project_generator').version
122-
exporter_yaml['project_generator']['version'] = version
123-
exporter_yaml['project_generator']['active'] = True;
124-
exporter_yaml['project_generator_definitions'] = {}
125-
version = pkg_resources.get_distribution('project_generator_definitions').version
126-
exporter_yaml['project_generator_definitions']['version'] = version
127-
except ImportError:
128-
pass
129-
with open(os.path.join(tempdir, 'exporter.yaml'), 'w') as outfile:
130-
yaml.dump(exporter_yaml, outfile, default_flow_style=False)
131111
# add readme file to every offline export.
132112
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))
133113
# copy .hgignore file to exported direcotry as well.
134-
copy(os.path.join(exporter.TEMPLATE_DIR,'.hgignore'),tempdir)
135-
zip_path = zip_working_directory_and_clean_up(tempdir, destination, project_name, clean)
114+
if exists(os.path.join(exporter.TEMPLATE_DIR,'.hgignore')):
115+
copy(os.path.join(exporter.TEMPLATE_DIR,'.hgignore'),tempdir)
116+
117+
if zip:
118+
zip_path = zip_working_directory_and_clean_up(tempdir, destination, project_name, clean)
119+
else:
120+
zip_path = destination
136121

137122
return zip_path, report
138123

0 commit comments

Comments
 (0)