Setting permissions of python module (python setup install)?

I'm not very knowledgeable about disutils, but I am guessing that If you dig through it until You find the place where your files are written then you will see the path variable on that line.

I'm not very knowledgeable about disutils, but I am guessing that If you dig through it until You find the place where your files are written then you will see the path variable on that line. This page might help you.

Os.path. Dirname(_file_) may be what you're looking for. _file_ in a module returns the path the module was loaded from.

Assuming yourmodule is a folder containing Something. Py, in setup. Py: import os #setup(...) call here from yourmodule import Something print os.path.

Dirname(Something. __file__) The only wrinkle with this would be if your file structure has yourmodule in the same dir as setuputils. In that case, the python loader would preferentially load yourmodule.

Something from the current dir. Two somewhat hackish but effective options to subvert that could be to either Remove the current directory from the python path, forcing it to load from the files that now exist in site-packages: import sys sys. Path = sys.

Path1: Temporarily rename the yourmodule folder right before the import statement. With option 1, the whole thing is: import os import sys #setup(...) call here #Remove first entry in sys. Path which is current folder (probably impl dependent, but for practical purposes is consistent) sys.

Path = sys. Path1: from yourmodule import Something print os.path. Dirname(Something.

__file__) I just tested this with one of my setup. Py and it works great. Good luck!

I find that the module is installed without o+rx permissions using disutils I don’t remember right now if distutils copies the files with their rights as is or if it just copies the contents. (in spite of setting umask ahead of running setup. Py) I’m not sure how umask and file copying from Python should interact; does umask apply to the system calls or does it need to be explicitly heeded by Python code?

For example, is there a way to extract the ending location of the installation from within setup. Py? There is one, a bit convoluted.

What would you do with that information?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions