Project Tree Import
Project Tree Import
When creating a Workspace, when specfying the directories, it would be nice to be able to specify a file to import. The file would be a list of directories. Optionally, the list could be directories and file specifications, including wildcards. My project has 100s of directories of which ~60 make a Workspace - manually selecting these directories is tiresome. I have to select these for each Workspace in each clientspace I have.
Have you tried building the workspace using the Workspace, Workspace Builder menu 
Cheers Jussi
PS: It is very easy to create a Zeus Workspace form a list of files: http://www.zeusedit.com/forum/viewtopic.php?t=39

Cheers Jussi
PS: It is very easy to create a Zeus Workspace form a list of files: http://www.zeusedit.com/forum/viewtopic.php?t=39
Yes I have used the workspace builder. Out of ~200 directories, I only need ~60, so I have to manually select these, or let the Builder find them all, and delete the ones I don't need (worse option). I would prefereably like to populate a list from a text file listing the directories and full paths (much like the Builder lists them). Since the builder seems to create a list like this, I thought it would be ~simple to add an import button which would ask for a file and then read in that list.
The manual approach seems wrose than using the builder...
The manual approach seems wrose than using the builder...
It is a fairly straight forward exercise:The manual approach seems worse than using the builder...
Step #1: Given that this is an empty Zeus project:
Code: Select all
<Project name="Put your project name here" sorted="Yes">
<Folder name="A Folder for My Files" sorted="Yes">
</Folder>
</Project>
Code: Select all
D:\temp\file01.lua
D:\temp\file02.lua
D:\temp\file03.lua
D:\temp\file04.lua
D:\temp\file05.lua
D:\temp\file06.lua
D:\temp\file07.lua
D:\temp\file08.lua
D:\temp\file09.lua
D:\temp\file10.lua
D:\temp\file11.lua
Code: Select all
<file>D:\temp\file01.lua</file>
<file>D:\temp\file02.lua</file>
<file>D:\temp\file03.lua</file>
<file>D:\temp\file04.lua</file>
<file>D:\temp\file05.lua</file>
<file>D:\temp\file06.lua</file>
<file>D:\temp\file07.lua</file>
<file>D:\temp\file08.lua</file>
<file>D:\temp\file09.lua</file>
<file>D:\temp\file10.lua</file>
<file>D:\temp\file11.lua</file>
Code: Select all
<Project name="Project Name Goes Here" sorted="Yes">
<Folder name="My Files" sorted="Yes">
<file>D:\temp\file01.lua</file>
<file>D:\temp\file02.lua</file>
<file>D:\temp\file03.lua</file>
<file>D:\temp\file04.lua</file>
<file>D:\temp\file05.lua</file>
<file>D:\temp\file06.lua</file>
<file>D:\temp\file07.lua</file>
<file>D:\temp\file08.lua</file>
<file>D:\temp\file09.lua</file>
<file>D:\temp\file10.lua</file>
<file>D:\temp\file11.lua</file>
</Folder>
</Project>
It's hardly rocket science

Cheers Jussi
Python Script to create Workspace
If anyone is interested in the script to create a Workspace,
Code: Select all
import glob, os, fnmatch
def all_files( patterns, search_path, pathsep = os.pathsep):
patterns = patterns.split(";")
for path in os.walk(search_path):
for pattern in patterns:
for match in glob.glob(os.path.join(path[0], pattern)):
yield match
file_FileList = open("fileList.txt", "w")
file_DirList = open("project_dirs.txt", "rU")
line_prefix = " <file>"
line_suffix = "</file>\n"
file_FileList.write('<Project name="P4" sorted="Yes">\n')
file_FileList.write(' <Folder name="P4_WorkSpace" sorted="Yes">\n')
for line in file_DirList: # line = directory path
for match in all_files( search_path = line[:-1], patterns = "*.c;*.h", pathsep = "\n" ):
file_FileList.write( line_prefix + match + line_suffix )
file_FileList.write(' </Folder>\n')
file_FileList.write('</Project>\n')
file_FileList.close()
file_DirList.close()
-
- Posts: 26
- Joined: Tue May 08, 2007 7:05 pm
Re: Project Tree Import
You can edit project file project_name.zpi with Zeus editor.mgag wrote:When creating a Workspace, when specfying the directories, it would be nice to be able to specify a file to import. The file would be a list of directories. Optionally, the list could be directories and file specifications, including wildcards. My project has 100s of directories of which ~60 make a Workspace - manually selecting these directories is tiresome. I have to select these for each Workspace in each clientspace I have.
It is fastest way to me.
You must not be in project "project_name" when edit project_name.zpi with Zeus.
Always make copy of project_name.zpi before and after editing.
If you make bad mistakes in project_name.zpi Zeus can erase all folder and files lines in it when you open project "project_name".
If that occur, close project "project_name". Copy saved project_name.zpi to original project folder. Correct mistakes. Save to original project folder and make copy of new project_name.zpi. Open project with Zeus editor.
Hi Petar,
Your checklist is very accurate. It is exactly what I do when I need to make a change to the project
The only thing I can add is to get the name of the project/workspace file I just select the Workspace panel, select the project or workspace item and then use the right mouse click, Copy name(s) to clipboard menu to get the name of the file
Cheers Jussi
Your checklist is very accurate. It is exactly what I do when I need to make a change to the project

The only thing I can add is to get the name of the project/workspace file I just select the Workspace panel, select the project or workspace item and then use the right mouse click, Copy name(s) to clipboard menu to get the name of the file

Cheers Jussi
This latest release adds the ability to drag and drop files and folders from the Windows Explorer onto any project node of the workspace.
This latest release can be found here: http://www.zeusedit.com/forum/viewtopic.php?p=5306
Cheers Jussi
This latest release can be found here: http://www.zeusedit.com/forum/viewtopic.php?p=5306
Cheers Jussi
Could you try posting this again to the Scripts section of the forumI wrote a python script to create Zeus Workspace projects and I have tried to upload it a few times but it gets blocked by the spam guard.

I have made a few changes that should hopefully mean it no longer gets blocked by the spam filter

If it does stil fail, them send me the message text and script as an e-mail I will use it to fix the spam filter.
Cheers Jussi