Get folder contents in SublimeText2 plugin - plugins

At first I want to say I'm a total beginner in Python so this question might be really stupid. I'm currently trying to learn something new and am developing a plugin for SublimeText2.
Can I get a list of files and folders in some directory in Packages folder of SublimeText2, what I basically want is a simple list. If yes, how can this be done?
I've searched the API for something like that, but the only thing that there is are commands that manipulate the currently open folders (the ones in the sidebar).

Ok, this was really stupid, I won't close the question as I think it may help others to start here. The reason I didn't find anything in SublimeText2 API is because this is the default Python functionality from the os library.
import sublime, sublime_plugin, os
#...
print(os.listdir(sublime.packages_path()))
Method sublime.packages_path() returns the path to packages folder.

Related

How to make a PowerShell script dowload a source

So I would like to know if it's possible to write a script that will download a sources like an .exe or .msi from a website like Git or any other website that I provide the right url.
My goal is to dowload the .exe or .msi compare his version to the soft already installed then either update it or do nothing depending the case ( This part will be easy since I already wrote it)
But since I don't know if it's possible to dowload a file and after some search I didn't find anything that was working for me at least.
Hope you guys can guide me to the light

Why default flutter folder names lib?

Just interesting why is names lib. The Entry point is main.dart, so it's a little bit strange to see main.dart inside lib folder.
I think it is because when we code in Flutter, we're composing the widgets to make it functional & importable, thus we call it our lib (library).
Besides that, Dart is a new thing in this time, it surely unique from any other existing programming languages, so "little bit strange" is understatement. For example, we use echo to print text on the screen. Why "echo"? Isn't it supposed to outputting a voice? It was strange, but eventually people will adapt with it. Strange will not strange anymore.
It is not strange, lib is directory and this name is hardcoded and there is no way to change it. The whole pub package system depends on that directory name. There is also a convention that tools like the analyzer support code in lib/src being considered package-private when not exported by files in other directories in lib/.
The Entry point is main.dart but you can change main.dart(entry point) to some other page in Flutter.
I think it's the most anti-pattern thing i've seen in 24 years of development. It's nonintuitive, names and pattern is made for human... machines don't care if a directory name is src, lib, abc, xyz or 123.

Eclipse JavaFX resource folder isn't showing folder/file but instead coming up as folder.file

I had a hard time searching for this problem because I can't figure out what search terms to use. I'm using Eclipse for JavaFX and I'm having an issue in this one project where my folders don't look right in package explorer. It's been giving me issues in my code saying it can't find folder/file1 because instead of having a folder that expands to show multiple files, instead I have four folders: folder.file1, folder.file2, folder.file3, etc.
I'm sure that's not very clear (which is why I'm having trouble searching it. So here's a few pictures.
What another project (in the same workspace!) looks like:
^^This is what I want (with subfolders under resources).
What I'm getting instead is:
And here is my folder structure to prove I'm not creating folders named with dots in the middle:
Is there some setting or something I can use to fix this? I had this issue early on with packages under the src folder but I was able to fix that through the build path. I cant figure out how to fix it now that it's not the source path.
Sorry if I'm asking a duplicate question, I just had a really hard time coming up with search terms for my problem.

Module 'socket" not found

Error when run
I created a program in ZeroBrane, and I compiled it using srlua.
However, since it has some usage of socket get requests, it seems like it is looking for files such as socket.dll to be in the same folder
I am aware that there are other questions just like this.
My socket should be somewhere in my lua folder, but I have found core.dll under the socket, which didn't work.
I'm wondering if I'm approaching this right, and looking for a way to make sure the program can find these files. (it seems to be more than one file required)
You need to have socket.lua in a folder that is available through package.path (or have to be packaged together with your script with srlua) and you also need to have socket\core.dll available through package.cpath, as socket.lua does require "socket.core" and expects to find a DLL that implements that.

sublime text - eclipse App Explorer equivalent

Hi I wondering if there is the equivalent to an App Explorer in Sublime Text 2.
When using eclipse, I use the App Explorer panel to search by file name.
I have a file naming convention that helps me find files by there functionality within the system.
So say I want to list all files relating to the registration process. I search for "regis" via the App Explorer and get a nice list of the relevant files. This filtered list is available all the time until I search again.
I can use Sublime Text's cmd+p but prefer the above as I can see the folder hierarchy etc.
In essence it is merely a file name filter on the folder list.
Are there any plugins that may give me something similar.
Any help much appreciated.
No, as far as I can tell nothing like this has been implemented in Sublime Text 2. I would suggest opening an issue at Sublime's UserEcho forum.
In the meantime:
Typing "regis" into Sublime's 'GoTo Anything' panel will bring up the files you're looking for, and show you their paths (I realize this doesn't help you with visualizing the hierarchy, but that's as close as it gets).
I use a package called SyncedSideBar - this will at least show you a visual representation of the folder hierarchy in the sidebar, for the open file, if it's added to the project.
The GoTo Folder package by freewizard may do something similar to what you're looking for, but I had trouble getting it to work. Maybe you'll have more success.
Good luck!