reox / FreeCAD_gitproject

Make Versioning FreeCAD Projects the easy way
GNU Lesser General Public License v2.1
8 stars 2 forks source link

Have you seen FC Webtools Workbench ? #1

Open luzpaz opened 6 years ago

luzpaz commented 6 years ago

https://github.com/yorikvanhavre/WebTools Specifically: https://github.com/yorikvanhavre/WebTools/blob/master/Git.py

reox commented 6 years ago

yes, I also wrote in the forum that features like autosave would be really nice: https://forum.freecadweb.org/viewtopic.php?f=8&t=23464#p198009

the menu from webtools is already very good, maybe i can merge the two workbenches

luzpaz commented 6 years ago

still thinking about this project. What have we learned up till now ?

reox commented 6 years ago

I have this workbench active all the time - no crashes so far :D

but: paths are delivered as unicode and those need to be sanitized for git - if a folder/file contains umlauts this is not good...

Unfortunately I had not much time to work on this project :/

luzpaz commented 6 years ago

but: paths are delivered as unicode and those need to be sanitized for git - if a folder/file contains umlauts this is not good...

@loooo could you possibly provide some assistance with this issue?

reox commented 6 years ago

Ah wait, I just looked at the issue... It's easier than you think:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 45, in hookedSaveFunction
  File "/home/reox/.FreeCAD/Mod/FreeCAD_GitProject/GitWrapper.py", line 19, in commitchanges
    FreeCAD.Console.PrintMessage("{} is not a git repo...\n".format(os.path.dirname(f)))
<type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode characters in position 16-17: ordinal not in range(128)

The Issue is that PrintMessage does not like unicode...

If you remove this log line it works fine.

luzpaz commented 6 years ago

@reox so what you are saying is if FreeCAD.Console.PrintMessage() could correctly interpret unicode then this feature would work?

reox commented 6 years ago

It already works; the functionality does not depend on PrintMessage. I'll see if I can fix the log messages.

reox commented 6 years ago

@luzpaz that wasnt too hard to fix... just use a unicode string. i.e. PrintMessage(u"sdf") works fine.

I also added the ability to create a repo.

Lot of features are still missing though...

luzpaz commented 6 years ago

can you make a list of TODOs ?

reox commented 6 years ago

kind of todo list: https://github.com/reox/FreeCAD_gitproject#features

luzpaz commented 6 years ago

CC @yorikvanhavre
Just thought you'd like to keep your eye on this.