> > def grep_stream(location): > return os.popen( > 'find %s -name "*.py" | xargs grep -h -P "^class > \w+\([\s\w,]+\)"'%location) > > Alas, looking at the man page for xargs it seems apparent that the -P > argument is meant for xargs whereas the -h argument is meant for grep, > right? So, I moved the -P arg to just after xargs and made it have a '1' > (otherwise xargs complains) and left the -h arg as is. >
The file works on my machine without complaint. I'm unfortunately not very familiar with unix commands. I'm not sure I'll be able to diagnose this issue. I find it odd that these commands aren't machine independent. When I run the script it finishes without complaints. However, the > mats.dot file and the mats.pdf are essentially nothing: mats.dot is > > homelap-3:sympy comerduncan$ cat mats.dot > strict digraph G { > rankdir=LR; > overlap=false; > } > It looks like the find+grep combination didn't pick anything up. You could try this command in the shell and see what you get. You should get a bunch of strings like the following to dump to the screen class Expr(Basic): So, what gives? Perhaps I am simply not using it correctly? > > I am running with python2.7 on my mac (Mountain Lion). All needed routines > are installed (macports is great). > Again, my guess is that the behavior of the unix tools is slightly different between MacOSX and Debian/Ubuntu. This surprises me. If anyone is more familiar with these tools I'd be happy to swap out what I have with something a bit more robust. I'd also be very happy if someone was able to replace this python script with a pure bash one. I suspect this program can be further simplified. This little script is cute and probably useful when one is trying to sort > out the class dependencies in a given project or just in general trying to > understand how things are hung together. > > Thanks for making this little tool. > Thanks for using it. -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.