Can I get a warning when editing code in site-packages? - pydev

When debugging with pydev, I frequently end up with an editor window for files in my site-packages directory. This can result in lost work, after doing python setup.py install thinking I made the change in my working directory.
Is it possible to have pydev warn me when editing files in site-packages?

Related

VSCode hides folder contents when certain files are opened

I have an angular project open in VSCode, but whenever I activate certain file tabs it hides every file & folder inside my src/ directory!
Here's a screen recording of what happens: https://imgur.com/kQrIUdQ
No other folders are affected, and nothing is actually chnaged in the src/ folder. I can seect a *.ts file, close VSCode, and then re-open it with that *.ts file active and the folder contents shows again until I activate a tab that does this again.
This is extremely annoying and I've never seen this happen before. let me know if you need any other information to help diagnose this issue.
Edit: My installed extensions are as follows:
Angular Language Service 0.1.11
AutoHotkey 0.2.2
C# 1.18.0
Code Spell Checker v1.6.10
Hosts Language v1.1.1
npm v0.3.5
npm Intellisense v1.3.0
Prettify JSON v0.0.3
stylelint v0.48.0
TSLint v1.0.0

Eclipse Clear Debug Shell

This is kind of a weird question so bear with me.
I found a way to allow unlimited output in the 'debug shell' view and then I executed a function in the Eclipse "debug shell" (used to be known as 'display') and it produced an output so large that it breaks my Eclipse. This forced me to reboot eclipse. Unfortunately, now everytime I open Eclipse it tries to open that view again, and so my eclipse is sort of permanently broken. Is there a settings file I can go into somewhere and dump so that it doesn't keep trying to load that garbage everytime I boot Eclipse?
Thanks
The answer lies somewhere in the eclipse .metadata directory (at the root of your workspace). I closed my eclipse, deleted this directory, and then restarted my Eclipse and was able to open up the debug shell again. Keep in mind this will delete all your Eclipse settings and have to restart from scratch again, however its worth it for me because I have to have this debug shell.

eclipse indigo major bug

I have been using Eclipse forever, but only today I upgraded to Indigo.
Using Eclipse Indigo on Mac 10.6 *
Files won't update after editing them and saving them. If I add blank lines and then save, then if I start debugging, the debugger will go through the lines that were there before, but now those lines are empty and the actual lines that the debugger is executing are a couple of lines below (due to the added blank lines). Debugger executes blank lines??!! Same thing if I change the code. If the file says X=5, and I change X=6, then debug, X will still be 5 ????!!!! Am I missing some editor caching option or smth ????
Things I have tried:
1. clean all projects, rebuild all projects
2. Delete projects, re-add them
3. delete files, write them from scratch
4. all auto-build and auto-refresh options are on
5. tried to change the workspace, the bug presists
6. tried to play around with the -xms128M and -Xmx786M option in the .ini file
7. tried restarting Eclipse and restarting computer
The problem was some discrepancy between the java version of the VM and the project's "facet" version. (whatever that is).
The thing I dont get is why the project was still running if there were problems reported on the "Problems" view and no new .class file was even compiled. Why it was running an outdated .java file, when the code on the actual display was different? (thus the ghost effect).
Is there an option that allows the eclipse to run outdated .class files if no new .class file could be compiled cause of compile errors?

pydev - setting up an existing python27 project complete with dlls and nested source folders in eclipse indigo

I am trying to set up a project in Eclipse Indigo with pydev on windows 7 Pro SP1 x64. The project exists in my drive (downloaded via tortoise svn) and has the following structure :
root\
launcher.pyw
settings.ini
modules\
__init__.py
module1.py
module2.py
...
more_modules\
__init__.py
moduleA.py
moduleB.py
...
compiled\
1.dll
2.dll
...
I have successfully imported the project in eclipse - specifying root/ as the project folder - and when I right click on the launcher.pyw and run the file the program runs alright (it is a gui application). I have 2 (main) issues :
I want to be able to run the project normally (tell eclipse that when I run the project I actually mean run the launcher.pyw) - when I right click on the project > Run as > Python-unit-test is the only option
I have, say, in more_modules\moduleA.py something like from .. import module1 which shows as an error - so how should I set it up correctly ?
Not sure about the dlls folder also - and not sure about the code analysis - aparently I have to open a file to see the errors - but those belong to another question maybe
The project sourceforge page is : http://oblivionworks.svn.sourceforge.net/viewvc/oblivionworks/Programs/Wrye%20Bash/
The root/ is Mopy/
Edit: moved the picture from my comment:
Regarding launching, you can simply open the file and press F9 to run it. After that, if you've set to rerun the last launch in the preferences (see instructions at: http://pydev.org/manual_101_run.html), you can simply press Ctrl+F11 to rerun it.
I took a look at your sf page and noted you didn't commit the .project and .pydevproject files (please do, so that anyone using PyDev can get things configured directly).
Regarding your import error in the code analysis, it'd be nice if you can actually provide the real example (from your description the error is that you have a '.py' in the end of the module that probably shouldn't be there, but it may be just a description... if it runs and code-analysis doesn't get it, please create a project with that use case and attach it in a bug-report in the pydev sf tracker).
As for the code analysis, usually you really have to open a file to see errors, but you can also right-click a folder and choose pydev > code analysis and it'll do a code-analysis for all the files beneath that folder that are a part of your pythonpath.

Setting up Pylint with PyDev

I have installed pylint via easy_install. I can run pylint <filename> with success. But pydev refuses to use it.
I checked "use pylint"
I configured correct path
I updated my python interpreter in eclipse to have pylit in pythonpath
I use Eclipse Galileo
I have build automatically checked
I tried cleaning whole project and no errors
What am I doing wrong?
I'm guessing you may need to mark the folder that contains your code as a source folder. You can do this under project properties.
Project->Properties->PyDev-PYTHONPATH
add relevant folders to the list of sources.
I've noticed that Pydev won't run Pylint on files with dashes (hyphens) the the filename; according to the Pydev devs, '-' is not a valid Python module name character, and it doesn't look like they intend to fix it:
http://sourceforge.net/tracker/index.php?func=detail&aid=1915426&group_id=85796&atid=577329
http://sourceforge.net/tracker/index.php?func=detail&aid=2888890&group_id=85796&atid=577332
As if nobody writes scripts in Python... Grumble grumble...
To provide an alternative solution, pylint can be used as an External Tool in Eclipse. This requires having previously installed the pylint package for a Python installation.
Remember to first have a pylintrc file somewhere where pylint can find it, failing which a "No config file found" error is printed. Typically I would touch pylintrc inside the project directory, and keep the file in version control. For reference, see pylint command-line options.
In Eclipse, select Run, External Tools, External Tools Configurations.... Click the toolbar button to create a New launch configuration. Configure as below or as desired:
Name: pylint
Location: ${system_path:pylint}
Working Directory: ${project_loc}
Arguments: --reports=n "${resource_loc}"
Remember to click inside an open file to switch focus to it before running the above external tool for it. Failing this, an error can occur.
The output of the external tool will by default be printed to the console.
Related: Setting up pep8 as an External Tool in Eclipse