Browse Source

first commit

Benjamin Vinot 3 years ago
commit
c9bc401763
7 changed files with 139 additions and 0 deletions
  1. 6 0
      .idea/encodings.xml
  2. 14 0
      .idea/misc.xml
  3. 8 0
      .idea/modules.xml
  4. 8 0
      .idea/sony.iml
  5. 40 0
      .idea/workspace.xml
  6. 23 0
      main.py
  7. 40 0
      template.xml

+ 6 - 0
.idea/encodings.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding">
+    <file url="PROJECT" charset="UTF-8" />
+  </component>
+</project>

+ 14 - 0
.idea/misc.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
+    <OptionsSetting value="true" id="Add" />
+    <OptionsSetting value="true" id="Remove" />
+    <OptionsSetting value="true" id="Checkout" />
+    <OptionsSetting value="true" id="Update" />
+    <OptionsSetting value="true" id="Status" />
+    <OptionsSetting value="true" id="Edit" />
+    <ConfirmationsSetting value="0" id="Add" />
+    <ConfirmationsSetting value="0" id="Remove" />
+  </component>
+  <component name="ProjectRootManager" version="2" project-jdk-name="Python 2.7.8 (/usr/bin/python2.7)" project-jdk-type="Python SDK" />
+</project>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/sony.iml" filepath="$PROJECT_DIR$/.idea/sony.iml" />
+    </modules>
+  </component>
+</project>

+ 8 - 0
.idea/sony.iml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="jdk" jdkName="Python 2.7.8 (/usr/bin/python2.7)" jdkType="Python SDK" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 40 - 0
.idea/workspace.xml

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ChangeListManager">
+    <option name="TRACKING_ENABLED" value="true" />
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
+  <component name="CreatePatchCommitExecutor">
+    <option name="PATCH_PATH" value="" />
+  </component>
+  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
+    <OptionsSetting value="true" id="Add" />
+    <OptionsSetting value="true" id="Remove" />
+    <OptionsSetting value="true" id="Checkout" />
+    <OptionsSetting value="true" id="Update" />
+    <OptionsSetting value="true" id="Status" />
+    <OptionsSetting value="true" id="Edit" />
+    <ConfirmationsSetting value="0" id="Add" />
+    <ConfirmationsSetting value="0" id="Remove" />
+  </component>
+  <component name="ShelveChangesManager" show_recycled="false" />
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <created>1517330709264</created>
+      <option name="number" value="Default" />
+      <updated>1517330709264</updated>
+    </task>
+    <servers />
+  </component>
+  <component name="VcsContentAnnotationSettings">
+    <option name="myLimit" value="2678400000" />
+  </component>
+  <component name="XDebuggerManager">
+    <breakpoint-manager />
+    <watches-manager />
+  </component>
+</project>

+ 23 - 0
main.py

@@ -0,0 +1,23 @@
+#-*- coding: utf-8 -*-
+
+import os
+from xml.etree import ElementTree as ET
+
+doc = ET.parse("template.xml").getroot()
+
+
+def folder_walk(folder, indent, root):
+	indent += "\t"
+	for folder_un in folder.findall('folder'):
+		print indent + u"⊢ " + folder_un.get('name')
+		folderpath = os.path.join(root, folder_un.get('name'))
+		os.mkdir(folderpath)
+		folder_walk(folder_un, indent, folderpath)
+	for file_elmt in folder.findall('file'):
+		print indent + u"⊢ " + file_elmt.get('name') + " - " + file_elmt.get('data')
+
+
+for content in doc.findall('content'):
+	print content.tag
+	folder_walk(content, " ", "./")
+

+ 40 - 0
template.xml

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<template type="ProjTempl" version="1.0" supplier="GNU ARM Eclipse"
+	revision="1.0" author="Maxim Integrated" copyright="Copyright (c) 2016 Maxim Integrated Products"
+	id="max32560.exe.c.project" label="%MAX32560.Ctemplate.label"
+	description="%MAX32560.Ctemplate.description" helƒp="help.html">
+	<content>
+		<folder name="docs">
+			<folder name="picture">
+				<file name="img001.jpeg" data="{05650456745406}" />
+				<file name="img002.jpeg" data="{05650898770406}" />
+				<file name="img003.jpeg" data="{05854454521406}" />
+				<file name="img004.jpeg" data="{05650886745644}" />
+				<file name="img005.jpeg" data="{05854689568985}" />
+			</folder>
+			<folder name="movie">
+				<file name="mov001.avi" data="{56565456745406}" />
+				<file name="mov002.avi" data="{56565898770406}" />
+				<file name="mov003.avi" data="{56565454521406}" />
+				<file name="mov004.avi" data="{56565886745644}" />
+				<file name="mov005.avi" data="{56565689568985}" />
+			</folder>
+			<folder name="music">
+				<file name="song001.mp3" data="{05645454745406}" />
+				<file name="song002.mp3" data="{05645454770406}" />
+				<file name="song003.mp3" data="{05845454521406}" />
+				<file name="song004.mp3" data="{05645454745644}" />
+				<file name="song005.mp3" data="{05845454568985}" />
+			</folder>
+			<folder name="data">
+				<file name="data001.dat" data="{05645645445406}" />
+				<file name="data002.dat" data="{05689845470406}" />
+				<file name="data003.dat" data="{05845445421406}" />
+				<file name="data004.dat" data="{05688645445644}" />
+				<file name="data005.dat" data="{05868945468985}" />
+			</folder>
+		</folder>
+	</content>
+
+</template>
+