i use aptana-studio 3 on mac for coding php
my problem is auto-complete does not work
But it works well When I press ctrl-space
The second question
how i can change zen coding key from ctrl-e to ctrl-j
thanks and sorry for my bad English
To change the key-binding, you will have to edit the Zen-Coding 'Ruble'.
As far as I understand, you already have the Ruble in your installed set of Rubles. If not, you will need to grab by clicking 'Command -> Bundle Development -> Install Bundle' and select 'Zen Coding'.
Once you have the Ruble installed, follow the instructions on how to edit the Zen coding Ruble ( http://wiki.appcelerator.org/display/tis/Modifying+an+existing+Ruble ), and edit the 'expand_abbreviation.rb' file ( https://github.com/aptana/zen-coding.ruble/blob/master/commands/expand_abbreviation.rb ).
Note the cmd.key_binding.mac = "M1+E". You just need to set it as cmd.key_binding.mac = "M1+J" and restart the studio.
There has been recent work done in Aptana Studio in making content assist (auto-complete) pop up automatically more often across languages. This should improve in the 3.0.3 release. If you like, you can try beta versions of that by visiting here: http://wiki.appcelerator.org/display/tis/Changing+the+Update+Type
Related
In sublime text 2 I simply used Enhanced-R in order to use the cmd+enter hot key to evaluate a snippet of code in SublimeREPL or the native R app. As far as I can tell, this package doesn't exist for ST3. So, might I change the key binding, currently, control+,,l (control and comma, then l), to cmd+enter?
I imagine I need to modify the file found here: Preferences > Package Settings > SublimeREPL > User or Preferences > Keybindings - User, but am not sure which or what to add.
Thanks for any leads.
Check out R-Box. Enhanced R was rewritten some time ago as R-Box, both are by the same author - R-Box mainly has much extended functionality, including a new menu when .R files are active. ⌘Enter (or CtrlEnter on other operating systems) should still work the same way. You'll have to redo your customized settings, of course, but all in all the new plugin is nicer and has many more features than the old one.
I'm using Aptana Studio 3 and am looking for a command that will take me to the previous editor I was in (a la Netbeans ctrl-tab or Eclipse's ctrl-F6). I've tried several commands with promising sounding names but none of them seem to behave properly. Any thoughts?
Go to Windows->Preferences->General->Keys and have a look at the key binding you have set for the commands 'Next Editor' and 'Previous Editor'. Type those commands in the filter search box to save yourself having to scroll.
On Windows the shortcuts for next and previous editor are in fact Ctrl+F6 and Ctrl+Shift+F6 respectively, which also happen to be the defaults in Eclipse. So if your key bindings for those commands are not set then you can set them here.
I'm writing a php file, and whenever I start to type
<h1>
I get this "snippet" of sorts,
//
// aptanavfs254116982902025803overrides.inc
// wordpress
//
// Created by Mike on 2011-08-15.
// Copyright 2011 Mike. All rights reserved.
//
What is this? I guess snippet is the wrong term. Template seems to be the wrong term. Googling doesn't seem to reveal people with this similar problem.
(Using Aptana Studio 3)
EDIT: I've found that it's somehow a shortcut for "Insert Comment Header" but there is still nothing that guides me to a preference to change this.
The "Insert Comment Header" command is actually contributed by the source ruble. It looks like the trigger keyword is "head", so if you start typing 'he' it will show this command as a suggestion. If you would like to remove this, you would need to edit the ruble.
Go to Commands > Source > Edit this ruble, to open the ruble. Then under the commands folder, open the insert_source_header.rb. You can then edi the "cmd.trigger" field to something else so it doesn't get triggered when you type "head".
For more information on editing rubles, you can always go to
http://wiki.appcelerator.org/display/tis/Modifying+an+existing+Ruble
(There should be information there to do more advanced things with rubles)
We're running a Zope server with an eventually large-ish number of Plone (4) sites. Every now and then, an extension product update comes along and requires a re-install to pick up changes in the profile settings, e.g. new content types.
Manually, this would mean clicking through to every Plone site's portal_quickinstaller, tick the products, press update. This is not very feasible if we're talking about dozens of sites, so I'm trying to automate this. Essentially so far, I have the following living as a Script(Python) in the Zope root:
a = context.restrictedTraverse('/')
p = a['Plone']
print p.getSiteManager()
qi = p.restrictedTraverse('portal_quickinstaller')
print qi
qi.reinstallProducts('LinguaPlone')
(Simplified; in reality I have a longer list instead of the single Plone instance, and I might want to reinstall a longer list of products.)
This fails with the following:
Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 613, in uninstallProducts
Module Products.CMFQuickInstallerTool.InstalledProduct, line 272, in uninstall
Module Products.CMFQuickInstallerTool.InstalledProduct, line 351, in _cascadeRemove
AttributeError: 'BaseGlobalComponents' object has no attribute 'objectItems'
From my debugging attempts so far, the BaseGlobalComponents is the Zope SiteManager returned by the zope.component.getSiteManager. How do I convince quickinstaller to pick up the right one, i.e. the one from the Plone Site it's living in?
Alternatively, how would I go about automating re-installing products in a way that will remain vaguely feasible for larger installations? (ETA: I'm aware this is not the kind of thing you do automatically with a cronjob, but updates of inhouse-developed products can't be avoided, I'm afraid.)
Here's how to change the active local site manager. You won't be able to do this in Restricted Python, so you'll need to turn your Python script into an External Method or browser view.
from zope.app.component.hooks import setHooks, setSite
setHooks()
setSite(site)
The setHooks call only needs to be done once. In Zope 2.12 these calls should be imported instead from zope.site.hooks and in Zope 2.13 from zope.component.hooks.
Keep in mind that calling reinstallProducts is not appropriate for all add-on products, and not recommended unless you've carefully checked what reinstalling does and are sure it won't cause problems. Some products provide upgrade steps that run actions more selectively.
Disclaimer: are you sure you want to do this? Automatically reinstalling and upgrading products to the latest version, blindly and without any testing on a staging instance, is asking for trouble.
Anyway, you can do such a thing using XML-RPC and a little tweaking. This is how you install a product on a live running instance using XML-RPC:
>>> import xmlrpclib
>>> proxy = xmlrpclib.ServerProxy(
"http://admin:passwd#localhost:8080/Plone/portal_quickinstaller"
)
>>> proxy.getProductVersion('Marshall')
'2.0'
>>> proxy.isProductInstalled('Marshall')
'False'
>>> proxy.installProduct('Marshall')
'Registry installed sucessfully.\n'
>>> proxy.isProductInstalled('Marshall')
'True'
To reinstall you need subclass Products.CMFQuickInstallerTool.QuickInstallerTool.py and provide you custom QuickInstallerTool with a method that has the keyword argument "reinstall" set as 'True' by default; something like:
442c442
< swallowExceptions=None, reinstall=False,
---
> swallowExceptions=None, reinstall=True,
452,457c452,457
< if self.isProductInstalled(p):
< prod = self._getOb(p)
< msg = ('This product is already installed, '
< 'please uninstall before reinstalling it.')
< prod.log(msg)
< return msg
---
> #if self.isProductInstalled(p):
> # prod = self._getOb(p)
> # msg = ('This product is already installed, '
> # 'please uninstall before reinstalling it.')
> # prod.log(msg)
> # return msg
Even better: provide your own method for gathering information about versions and reinstalling a product, compatible with the XML-RPC protocol (as you cannot pass keyword arguments).
There might be cleaner ways of doing this via XML-RPC, but portal_quickinstaller is not meant to be used in this way and there may be caveats. Use with caution.
I have got this python script in the Zope root of an instance with 7 Plone Sites. Looks pretty much the same as what you have. It might be that it only works on this Plone 2.5 site (yes, old), but I think it should work on 3.x and 4.x as well. Maybe an an innocent looking difference (that I am overlooking) causes the error in your script; maybe the restrictedTraverses that you do trip it up. (Script edited for clarity.)
SITES = ['site-1', 'site-2']
for site in SITES:
print "Reinstalling LinguaPlone in %s." % site
portal = context[site]
qi = portal.portal_quickinstaller
qi.reinstallProducts(['LinguaPlone'])
First don't do a reinstall it can break your website in many cases.
Next you have to consider that add-ons may provide an upgrade step (usually they will). Use the quickinstaller api to achieve this in PythonScript. It is good but it can also be achieved with a script on the file system. Check the examples here: http://svn.plone.org/svn/plone/plone.org/Products.PloneOrg/trunk/scripts/
Another solution can be to use the Selenium IDE to record the quickinstaller stuff in one site and make a copy paste the results of that tests to run it on another website (very weird isn't it ?)
I'm able to generate patch files from one version to another using NSIS' Vpatch.
Let's say I have mydll.dll version 1, and I have a patch to update it to version 2. Then I have a new version again, thus I generate another patch to update it to version 3.
What bothers me though is, what if user cancels updating to version 2 and so forth. Then my latest version let's say is version 20. User decides to update to version 20. Is there a way to generate a patch that's like accumulative in nature? whereas user can jump from version any old version to the newest version (i.e ver 3 to ver 20) without passing through the versions in between?
I've read this line in vpatch's documentation ---> "if you want to be able to upgrade version 1 and 2 to version 3, you can put a 1 > 3 and 2 > 3 patch in one file." But how do I that?
What if I alread have like 30 versions. Does that mean I have to create a patch whose arguments are old files(versions 1-29) and new file(version20)?
I'd say you have two options:
Every time you have a new version you GENPAT a patch for every previous version to the new version
GENPAT just from New-1 to New (Appending to a patch file that already had New-2 to New-1 etc) and keep calling vpatch::vpatchfile at install-time till the return value is "OK, new version already installed" and not just "OK" (You don't need a archive of all old versions for this, but it will take longer for the user to apply the update if they had skipped many updates)
VPatch is an open source project in itself so you could ask in their forum. The guy wrote it says you can ask him questions. There is a link from his page to the email form: http://www.tibed.net/vpatch/