Home Download Buy Blog Forum Support

WinSCP integration

Re: WinSCP integration

Postby gpfsmurf on Sun Nov 01, 2009 2:19 am

myel wrote:one feature that would be very cool: set a subfolder of the remote server as an project mount point, so we can use sublimes project management features...


@ myel: could you open a new issue on the bitbucket page so I don't forget? If possible with some details about how you would like this to work exactly... We could have a 'remoteDir' option in the local project, or do you want a copy of the project on the server? etc

On the page: Issues -> New Issue -> Create new -> put some info and set Type to enhancement

Thanks!
gpfsmurf
 
Posts: 211
Joined: Mon Jun 23, 2008 6:31 pm

Re: WinSCP integration

Postby myel on Sun Nov 01, 2009 10:23 pm

hm,

i nearly got it working myself...

i just added a recursive function to iterate though all subdirectories ( please bear with me, first time i do something with python ):
Code: Select all
    def get_folder_list(self, folder, wait=1):
        files = self.recursive_get_folder_list( folder )
        # rewrite / to \ so we can use the sublime directory filter stuff
        renamed = []
        for singleFile in files:
            renamed += [singleFile.replace( "/", "\\")]
        yield renamed
       
    def recursive_get_folder_list(self, folder, wait=1):
        entries = self.winscp.listDirectory(folder)
        files = []
        dirs = []

        for line in entries:
            try:
                info = parse.parse_ftp_list_line(line.rstrip())
            except:
                continue

            if not info:
                continue

            name = info.name
            isDir = info.try_cwd
            if name in ['.', '..']: continue
            if isDir:
                dirs += [folder + '/' + name]
            else:
                files += [folder + '/' + name]
       
        # recursivly iterate through subdirectories
        for subDir in dirs:
            files.extend( self.recursive_get_folder_list( subDir ) )
           
        # yielding so scheduled.threaded works
        return sorted(files)   


i have to replace / with \ so i can use sublimes directory file stugg ("\foo index.html"), but it breaks everything else :).

is there any way that i can get / working?
myel
 
Posts: 88
Joined: Sat Mar 22, 2008 11:26 pm

Re: WinSCP integration

Postby vim on Mon Nov 02, 2009 6:47 am

python has a lib for that: os

look more on os.path.normpath(path), see http://docs.python.org/library/os.path.html
vim
 
Posts: 298
Joined: Tue May 27, 2008 6:51 pm

Re: WinSCP integration

Postby Anomareh on Mon Dec 14, 2009 6:11 pm

I'm trying to get this plugin to work but can't seem to. I have AAA and WinSCP installed. I can use WinSCP just fine. When I open Sublime though and hit F12 nothing happens.

Any ideas what I'm doing wrong?

Thanks.

EDIT: All is well now. My problem was fixed in the latest push.
Anomareh
 
Posts: 221
Joined: Thu Oct 01, 2009 7:32 pm

Re: WinSCP integration

Postby S0und on Tue Mar 02, 2010 7:57 am

http://pastebin.com/bKhmYRwi

when i try to go inside a subfolder under the host, i got this error
S0und
 
Posts: 70
Joined: Wed Oct 28, 2009 4:12 pm

Re: WinSCP integration

Postby gpfsmurf on Tue Mar 02, 2010 9:03 pm

Does your FTP have file names that have special characters or non-english characters (i.e. 'ö')?
gpfsmurf
 
Posts: 211
Joined: Mon Jun 23, 2008 6:31 pm

Re: WinSCP integration

Postby S0und on Fri Mar 05, 2010 10:16 am

gpfsmurf wrote:Does your FTP have file names that have special characters or non-english characters (i.e. 'ö')?


:roll: yes
S0und
 
Posts: 70
Joined: Wed Oct 28, 2009 4:12 pm

PreviousNext

Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 9 guests