![]() nd_file(remotefile, ername, self.password, view.file_name(), self.get_content(view, view.file_name())) Remotefile = self.host view.file_name() R.add_header('Content-Type', content_type) ![]() ![]() R.add_header("Authorization", "Basic %s" % base64string) Opener = urllib2.build_opener(urllib2.HTTPHandler)īase64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '') Jcrroot = "/Users/tgoirand/dev/website/src/main/resources/jcr_root/"ĭef send_file(self, url, username, password, file_name, content): Import sublime, sublime_plugin, urllib, urllib2, base64Ĭlass CQCommand(sublime_plugin.EventListener): Paste the following content in the document In a similar style to the previous bash script example, we can write a plugin to send automatically any file to the JCR repository whenever it is saved under the jcr_root file system path. ![]() Sublime Text 2 (for Sublime 3 see comments) allows its users to create plugins using Python. ~/bin/send-to-cq.sh /Users/tgoirand/project-website/src/main/resources/jcr_root/apps/project/components/page/errorpage/* Edit local files using Sublime Text and sync them with JCR repo on save event. JCR_ROOT=’\/Users\/tgoirand\/project-website\/src\/main\/resources\/jcr_root\/’ Public Drive initDrive() throws IOException, GeneralSecurityException " done
0 Comments
Leave a Reply. |