I know this gets asks occasionally: "How do I import win32api?". Well you can't...at least not out of the box. This is where Pywin32 comes in. I recently started throwing together a plugin that needed pywin32 so I could show Windows notification bubbles from sublime:

Notice, you just need to call import Pywin32.setup once before your plugin accesses any win32api, win32com, etc. calls. Technically it only needs to be called once when Sublime starts, but there is no guarantee your plugin will start after Pywin32 gets loaded. That is why your plugin just needs to make sure by manually including it.

Interesting. Another step closer to finally being able to utilize Sublime Text as a cross-platform shell replacement / portable environment platform. At least reducing the alt+tab frequency while working.

I need to get plain text from clipboard (sublime.get_clipboard() not work with copied file object viewtopic.php?f=6&t=15068), but sth like this doesn't work:OpenClipboard() d=GetClipboardData(win32con.CF_TEXT) # get clipboard dataSetClipboardData(win32con.CF_TEXT, "Hello") # set clipboard dataCloseClipboard()

Why try to extract the file path from a file object in clipboard? Why not just hold shift in explorer, right click the file, and select "Copy as path"?

If this is unacceptable, I would try and read through the pywin32 documentation. I frankly don't have the time to be a consultant for pywin32, I simply provide the package to help people out. I'm sorry I cannot be of more help right now.

Thinking about dropping support for this. I only have one plugin that uses it, and I am in the process of moving to using ctypes instead. There looks to be maybe around 400 installs on Package Control, not sure how many actively even use this.

As I can do most things with ctypes directly, which saves me this extra dependency, I have no personal use for it anymore; therefore, I have no desire to continue supporting it. My support for packages is usually tied to my personal usage. If anyone wants to take over, let me know. I think once I finish getting my plugin weened off this, I will give it a month to see if anyone wants to take it over, if not, I may transfer it over to SublimeText organization or just kill it off completely.

To be honest, if someone where taking this over, it would make more sense to implement it as a package control dependency than its current usage model; maybe I will kill it off and let someone re-implement it as a dependency if there is a strong enough desire for it.

I can easily translate the package into a dependency since I spent quite a bit of time with Pc's internals in that regard and know how it works. I don't think I would be able to provide support however (never used itit so far) , so moving it to the sublime text org is probably better.

FichteFoll wrote:I can easily translate the package into a dependency since I spent quite a bit of time with Pc's internals in that regard and know how it works. I don't think I would be able to provide support however (never used itit so far) , so moving it to the sublime text org is probably better.

That would be great. I figure the people who can't figure out how to get things working with ctypes and want to use PyWin32 can just contribute to the Sublime Text org if they run into troubles with it. That way the people who are actually using it can make things better. As I have spent more time with ctypes, it's really not that hard to use instead of PyWin32, though you are working with less of an abstraction layer making you do a little more reading. So yeah, PyWin32 can be more accessible at times, but not having the extra dependency is nice as well.

On a side note, I have been looking into dependencies, for Package Control. How do you setup Package Control to test out dependencies locally? I wouldn't mind setting up PyWin32 myself, but I'm just not sure yet how you validate it locally.

facelessuser wrote:On a side note, I have been looking into dependencies, for Package Control. How do you setup Package Control to test out dependencies locally? I wouldn't mind setting up PyWin32 myself, but I'm just not sure yet how you validate it locally.

I don't think it's m.tiond anywhere, but you can add channel or repository JSON files to PC's config that are on your hard drive. I used that to test much of the dependency installation stuff and quicks that existed in 3.0.0 and have been fixed in 3.0.1. Unfortunately, I couldn't seem to get PC to install packages from the hard drive, so I had to upload the test package to a web server.

Following is an excerpt of my local .json file that I added to PC's "repositories" setting: