[Draft] Development Environment for Python
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: [Draft] Development Environment for Python
what about a common git repo? there would be an easy way to get updated scripts on a simple way?yorik wrote:Indeed our wiki truncates big scripts. So far nobody has been able to find out why and solve that problem...
Until now we all managed more or less the way Dan explained, by posting the complete script elsewhere... I wish we had a better solution...
Re: [Draft] Development Environment for Python
At the suggestion of another forum member I set up a github account et al the other week and then found out that git doesn't like people to extract single files. And if they insist then it Zips the files on them. Plus git is anything but intuitive for non-programmers to use.microelly2 wrote:what about a common git repo? there would be an easy way to get updated scripts on a simple way?
I've just migrated the abbreviated scripts to PasteBin as suggested by danielfalck and it seems to work fine. It supports Save As from the link (git doesn't), it will deliver single files in non-Zipped form (git doesn't)
Also you can get the source up in its original form simply by clicking on the link - if git supports this then I didn't find out how.
It took me a couple of hours to set up github and create a user ID, with PasteBin the longest part was waiting for the confirmation email.
I had been looking for something that was easy for non-programmers and PasteBin seems much more that way to me. I think PasteBin and git are focussed on different user groups and it seems to me that PasteBin suits the non-programmer user much better.
Re: [Draft] Development Environment for Python
IMHO a shared repository for independent scripts does not make much sense. Having a single repo would mean that we need to control the access rights somehow. I personally prefer to create a "gist" for every project that exceeds about 50 lines of code. This a allows me to keep the history in a git repo but separated from unrelated scripts.microelly2 wrote:what about a common git repo? there would be an easy way to get updated scripts on a simple way?
Re: [Draft] Development Environment for Python
Github wil give you the posibility to download lndividual files if you use the Raw link or url.
https://raw.githubusercontent.com/yorik ... Release.py
https://raw.githubusercontent.com/yorik ... Release.py
Code: Select all
<!DOCTYPE html>
<html>
<body>
<a href="https://raw.githubusercontent.com/yorikvanhavre/FreeCAD/master/README" download>
<p><b>Note:</b> Downlowd file via raw link from github.</p>
</a>
</body>
</html>
- Attachments
-
- raw.png (26.23 KiB) Viewed 2132 times
Need help? Feel free to ask, but please read the guidelines first
Re: [Draft] Development Environment for Python
Anyway this is an interesting discussion.. piffpoof, I also suggest you use github's gists, but there are many other solutions, like pastebin, or simply attaching your full script in a post here on the forum...
But indeed we should think of a better way to store macros, and indeed one that allows easy update/upgrade by the script author and for the users...
But indeed we should think of a better way to store macros, and indeed one that allows easy update/upgrade by the script author and for the users...
Re: [Draft] Development Environment for Python
One thing I learned about PasteBin is that you can perform a Save Link As from the link on the FreeCAD Wiki page and then direct the file to the appropriate directory. This is something I was looking for with regards to macros etc. The user can right-click on a link and start the Save Link As process.yorik wrote:Anyway this is an interesting discussion.. piffpoof, I also suggest you use github's gists, but there are many other solutions, like pastebin, or simply attaching your full script in a post here on the forum...
But indeed we should think of a better way to store macros, and indeed one that allows easy update/upgrade by the script author and for the users...
Where PasteBin falls down is that it will not handle binary files like *.FCStd. I am looking for something so I can attach FreeCAD documents to Wiki documentation pages (either for Macros or for features of FreeCAD) such that the absolute beginners can download a document which has some prepared data in it. Then they can concentrate on what the documentation is describing - not the 99 steps necessary to get the data to the correct position. In essence, I would like them to be able to save a *.FCStd attached file the same as they can save the macro script - using the Save Link As.
Does anyone have a link to a gist I can try out? Linus Torvalds' brain and mine don't work the same way. And I would prefer not to try and figure out how to set it up on a Macintosh as it is so time consuming to do things at the command level when they are just different enough from regular Unix to be different.yorik wrote:use github's gists
But, as PasteBin does not handle binary files, the search goes on...
Re: [Draft] Development Environment for Python
https://gist.github.com/5263/1759773piffpoof wrote:Does anyone have a link to a gist I can try out?
https://gist.github.com/5263/2a980824adae2f8b2d53
https://gist.github.com/5263/2376960
https://gist.github.com/5263/2842792
https://gist.github.com/5263/4540334
https://gist.github.com/5263/5649053
https://gist.github.com/5263/8847217
https://gist.github.com/5263/9111947
https://gist.github.com/5263/997617e8e32cb6b97a7f
https://gist.github.com/5263/1e9c3266574fd9aebf29
https://gist.github.com/5263/0f1554decb1cd329f4ee
Re: [Draft] Development Environment for Python
thanks for the gist filesshoogen wrote:https://gist.github.com/5263/1759773
well as the saying goes, the plot thickens…
It seems that the behaviour of the repositories partially depends on which browser is used. I used the right-click option "Save File As" with the following 3 browsers:
Code: Select all
download of gist file from gisthub:
Chrome 1759773.html
Safari 1759773.html
Opera 1759773.html
Code: Select all
download of file from PasteBin:
Chrome raw.txt
Safari raw.php.txt
Opera raw.txt
It seems that the gist file always comes down in HTML format.
It seems that the PasteBin comes down in ASCII format, although Safari inserts a '.php' into the file name
For downloading Python the gist files would not work as the file type is wrong but more importantly the file is in HTML format.
None of the browsers are current releases, the versions were:
Code: Select all
download of file from PasteBin:
Chrome 40.0.2214.115
Safari 5.1.7
Opera 24.0
- PasteBin - works OK for Python files and right-click Save File As, does not handle binary (i.e. *.FCStd) files
- gist - Python comes down as HTML, unknown whether gist will handle binary files or not
Re: [Draft] Development Environment for Python
Is it not this you are looking for?
TEXT
https://gist.githubusercontent.com/5263 ... rusions.py
Binary
https://gist.github.com/mbostock/550354 ... mbnail.png
TEXT
https://gist.githubusercontent.com/5263 ... rusions.py
Binary
https://gist.github.com/mbostock/550354 ... mbnail.png
piffpoof wrote:shoogen wrote:https://gist.github.com/5263/1759773
Need help? Feel free to ask, but please read the guidelines first