python
Posted by: dnasty
Date: May 15, 2008 08:50AM

Hi, im new to Kmeleon browser. i found this code in the macrolibrary. its for version 1.0. Can someone please show me how to convert it to 1.1 for me? Thx

# Python menu
#in macros.cfg
go_Python{
menu=Main site
open("http://www.python.org/";);
}

exec_Python{
menu=Python
exec("python")
}


#in menus.cfg
&Python {
macros(go_Python)
macros(exec_Python)

}

Re: python
Posted by: JujuLand
Date: May 15, 2008 03:25PM

I don't see any interect to this menu.

It's really easier to create a bookmark than to add a menu which has only one entry, and which opens a webpage.


[edit]

Sorry, I haven't seen your macro to open python.
But isn't it more efficient to have a shortcut in the quicklaunch?

So, if you want it :

------------------
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ---------- Python menu for K-Meleon) -------------------------------------------
#
# Needed files  : python 
# Dependencies	: 
# Resources	    : -
# Preferences	  : 
# -----------------------------------------------------------------------------------------

# In case of manual install, registry keys can't be found and menu is grayed
# To Bypass it, just fill the content of this variable the example value adapted
# to your config
# Example :
# $_Python_Path="C:\\Python25\\Pythonw.exe \"C:\Python25\Lib\idlelib\idle.pyw\" -n -e \"%1\""
# or perhaps
# $_Python_Path="C:\\Python25\\Python.exe"
# You must restart K-Meleon to take the modifications
# You have a shortcut to modify this value:
# SHIFT+ALT+P

$_Python_Path="";

# ---------- General -----------------------------------------------------------

Python_Path{
$ext="kmm"; &getExtensionHandler; exec(sub("%1","macros\\Python.kmm",$cmdline));
}

_Python_CommandLine{
# try to get Python's command line from the Windows Registry
# First line Pythonw.exe, Second line Python.exe
# Comment and uncomment to choose which programme to use
$__data=sub(" \"%1\" %*","",readreg("HKCR","Python.File\\shell\\Edit with IDLE\\command\\"));
#$__data=sub(" \"%1\" %*","",readreg("HKCR","Python.File\\shell\\open\\command\\"));
$_Python_CommandLine=$__data;
$_Python_CommandLine==""?$_Python_CommandLine=$_Python_Path:0;
}

$OnStartup=$OnStartup."_Python_CommandLine;";

# ----- MACROS

Python_Webpage{
$OpenURL="http://www.python.org//";; &OpenURL_InNewWindow;

}

Python_Launcher{
menugrayed=($_Python_CommandLine=="");
exec($_Python_CommandLine);
}

# ----- PRIVATE

_Python_BuildMenu{

# Python menu
#
setmenu(PrivacySecurity,popup,"&Python",2);
setmenu("&Python",macro,"Python &web page",Python_Webpage);
setmenu("&Python",macro,"Launch &Python",Python_Launcher);
setaccel("SHIFT ALT P","macros(Python_Path)");
}

$OnInit=$OnInit."_Python_BuildMenu;";
# -----------------------------------------------------------------------------------------
$macroModules=$macroModules."Python;";
------------------

Save it as Python.kmm in macros folder

A+


Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:31.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/75.0

Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr





Edited 8 time(s). Last edit at 05/15/2008 08:39PM by JujuLand.

K-Meleon forum is powered by Phorum.