last updated 2 April 2006 please do not delete this document--flauxtext tries to look for it in Help > Readme. please skim this document before using flauxtext. it contains semi-relevant, probably useful information. ------------------------------------- Installation Notes ------------------------------------- Requirements: Windows 2k or later OR a POSIX-compliant OS Python 2.3 or later [script runtime engine] GTK [a graphical user interface runtime engine] PyGTK [python bindings for GTK] Suggested Packages: psyco [a JIT compiler] win32all [for transparency on windows NT] Xlib, pypanel [for transparency on unix] links to download these can be found on flauxtext's homepage: http://fauxlkner.sourceforge.net/ installation for flauxtext is literally as easy as unzipping it. [if only girls were this easy ;-] unzip the zip you downloaded, navigate to the new directory "flauxtext_r2", then double click/pythonw/start "flauxtext.pyw". it will find all the files it needs so long as they're in the same directory, whether or not that directory is named 'flauxtext_r2'. and yes, flauxtext.pyw is the only necessary source file; config.flauxtext, ui.xml, and icon.xpm are necessary configuration files. reg.py allows you to integrate flauxtext into explorer.exe [the windows shell and file manager] through the registry. it will ask you a short series of simple questions from the command line regarding how you want it to change your registry. it will then write 2 short *.reg files: one to change the registry in flauxtext's favor, the other to undo the effects of the first. if you answer "y" when it asks you if you want to go ahead and merge flauxtext.reg, it will os.startfile('flauxtext.reg'), exactly as if you'd double-clicked on it. the location of flauxtext which it puts into your registry is based on the location of reg.py (so don't separate it from flauxtext.pyw ;-). mk_shortcut.py writes a JScript which tries to put a hotkeyed link to flauxtext.pyw on your NT desktop. double click on the py, et voila. [again, the 'voila' is dependent on your keeping the script in the same directory as 'flauxtext.pyw'.] mk_script.py writes a batch/bash script in your path, effectively allowing you to type 'flauxtext [arguments]' on the command line in any directory. if you want to be able to "import flauxtext" in python, ensure that the directory housing it is in your PYTHON_PATH environment variable. to uninstall flauxtext, delete the directory "flauxtext_r2". if you ran reg.py, you need to merge 'remove_flauxtext.reg' before deleting the directory; and if you ran mk_script.py, delete 'C:\windows\system32\flauxtext.bat' or '/usr/bin/flauxtext'; and if you ran 'mk_shortcut.py', delete that desktop icon. ------------------------------------- Configuration ------------------------------------- to set everything correctly, open 'config.flauxtext' [in flauxtext itself, this is through the menuitem "Help > Open > Config File"]. the variables have english-based names like "tabsvisible", "tabbarlocation", "wordwrappref", and "windowtitle". configguide.html provides plenty of information on each variable. to set the commands used in the F5 functions, look for the variable named "runcmds" under your os section. this is a dict mapping fnmatch patterns to system commands. this variable is evaluated last, so you can reference other variables. all instances of '%(full)s' in the command will be replaced with the current file's full pathname, '%(dir)s' with the directory name housing the file, '%(base)s' with the file's basename [eg. "flauxtext" in "C:\\flauxtext.pyw"], and '%(ext)s' with the file's extension [eg. "pyw" in "C:\\flauxtext.pyw"]. the values of the runcmds dictionary can be either command strings or lists/tuples of command strings. if the pertinent value is a list/tuple, all but the last command will be os.popen()ed, then the last will be run through the 'wargs' and 'GetOutput' filters [possibly changing the command or how it's run]. for the smtp and ftp variables, note that you will always be able to specify different servers, usernames, etc. when you go to use the tools. if you don't know what your smtp server is, hunt around your ISP's website, or email them. if you don't know what your ftp server is, then you don't need to use that tool. you can comment it out of ui.xml. ui.xml is an eXtended Markup Language file describing the menubar and optional title bar. to enable to the toolbar, simply uncomment the ... section at the bottom, and arrange the s and s how you want. the action attributes of the toolitems should match the action attributes of the menuitems you want duplicated in the toolbar. eg., if you want to be able to toggle parentheses hilighting by clicking a button on the toolbar, put this between the ... tags: note that if you want a menuitem floating outside next to the menubar, move it outside of the tags. if you want another popup menu to further organize things, there are comments to help you do so. if you're completely lost, and you really want to change how something works, please post a detailed, clear question on my sf.net message board after reading all of this document and configguide.html https://sourceforge.net/forum/?group_id=137321 ------------------------------------- Time Format ------------------------------------- when you select Edit>Insert>Insert Date Time, timeformat is inserted at the cursor after being parsed by time.strftime(timeformat,time.gmtime(time.time()-time.timezone)) here are the valid splices and examples of what they produce: '%a' Fri #weekday '%b' Apr #month '%c' 04/29/05 15:36:19 #date [MM/DD/YY] and time [HH:MM:SS], equivalent to "%m/%d/%y %H:%M:%S" '%d' 29 #date of month '%j' 119 #day of year (this would be 1 if it were run on January 1) '%m' 04 #month number '%p' PM #AM or PM '%w' 5 #year number? '%x' 04/29/05 #date [MM/DD/YY] '%y' 05 #year number? '%z' Eastern Standard Time #timezone '%A' Friday #full weekday '%B' April #full month '%H' 15 #hour on 24 hour clock '%I' 03 #hour on 12 hour clock '%M' 36 #minute '%S' 19 #second '%U' 17 #week number of the year [Sunday as the first day of the week] '%W' 17 #week number of the year [Monday as the first day of the week] '%X' 15:36:19 #time [HH:MM:SS] '%Y' 2005 #full year '%Z' Eastern Standard Time #timezone '%%' % #a literal percent character i also scripted it to recognize and replace '\3p0k' time.time() #system time [milliseconds since the epoch] '\3P0K' time.time()-time.timezone #system time adjusting for timezone ------------------------------------- HotKeys [Shortcut/Accelerator Keys] ------------------------------------- i <3 hotkeys almost as much as i <3 python, so i tried to make flauxtext rely on the mouse as little as possible. however, you don't absolutely need to use the keyboard to do anything. you can check out what keys are mapped to what functions by looking at flauxtext's menus. underscores indicate that you can open those menu[items]s by hitting Alt+[underscored letter], just like every other good little GUI. note that PyGTK automatically maps certain keys thus: ['^' means that the Control button is held with the following character] ^C copy selected text to a clipboard ^X copy selected text to a clipboard, then delete it from the current buffer ^A select all text in the current buffer ^V paste text from the clipboard into the current buffer at the cursor PgDn scroll down a page at a time PgUp scroll up a page at a time ^[tab] moves focus from the current widget [textbuffer, menuitem, tab label] to another widget ^[Del] deletes text in front of the cursor whole words at a time shift+^[arrow] where [arrow] is any of the four arrow keys selects text in the direction of the arrow key pressed whole words at a time Escape closes opened menus F10 opens the File menu. equivalent to hitting Alt+f note also that since i can't change what these keys map to, i had to make other keys tab over to other documents. F11 shifts focus from the current document to the document opened immediately before the current one F12 shifts focus from the current document to the document opened immediately after the current one note also that flauxtext thinks very highly of the F5 key: if you happen to be editing a file whose extension is a key in "runcmds" [a variable in config.flauxtext], and you hit F5, magical things happen. open my source and look for flauxtext.runs(). the methods are in alphabetical order. if magic doesn't happen, check the runcmds variable set in config.flauxtext under your OS. ------------------------------------- Miscellaneous Notes ------------------------------------- to make the "-v" or "-h" command line options work on windows, you CANNOT use the batch script--you have to run python flauxtext.pyw -h whereas the batch script uses pythonw.exe, which disallows printing to the command line. cli-opts on POSIX-compliant systems should work perfectly. the status bar is new, and follows my minimalist instincts, so it might be somewhat cryptic. the little "a" or "A" indicates caps lock's status appropriately. the "ins" or "ovr" indicates insert mode or overwrite mode, respectively. "Ln" means "Line", and "Col" means "Column". and the big honkin' bar on the left [by default, anyway; you can move it] shows handy info, or random monty python quotes, every so often. if you want another peek into flauxtext's internals [and you have "checkforalreadyrunning" set to True in config.flauxtext], run one of these while you have flauxtext open: POSIX$>echo "/etc/fstab" > /tmp/instancetracking.flauxtext C:\windows>echo WM3D.INI > C:\temp\instancetracking.flauxtext *>python -c "import flauxtext, os; open(os.path.join(flauxtext.tempdir,'instancetracking.flauxtext'),'w').write(os.linesep.join(flauxtext.parseargs(['-x', os.path.dirname(flauxtext.__file__)])) #all of these should just instruct the already-open flauxtext to open files. [respectively: fstab in posix, wm3d.ini in windows, or all text files in the same directory as flauxtext.] in the statistics dialog, there are 2 text-entry widgets and a checkbox labeled "re". these 3 widgets let you find the number of any letter, word, or regexp pattern. enter any text in the left text-entry, and the right text-entry will automagically show you the number of times that text appears in the current buffer. check the "re" button if you want to use regular expressions [eg, to find how many '\t' [tabs] you have, etc.]. hit Alt + t + h, or Tools > Python help(module), then enter modules to see a list of all the modules/packages python can find. flauxtext is able to call another program which allows you to change your GTK theme: "gtk-chtheme" on POSIX, or "C:\\Program Files\\Common Files\\GTK\\2.0\\gtk2_prefs.exe" on windows NT. for more information on gtk-chtheme, check out its freshmeat page: http://freshmeat.net/projects/gtk-chtheme/ if you're on gentoo, emerge gtk-chtheme. to get the NT version, download/wget: http://fauxlkner.sourceforge.net/gtk2_prefs.exe to download GTK skins to make flauxtext pretty, check out these pages: http://prdownloads.sourceforge.net/heavymole/gtk2-theme-engines-win32-1.0.exe http://www.customize.org/list/gtk/5/5/ http://art.gnome.org/themes/gtk2/ i did not contact the maintainers of either gtk-chtheme or gtk2_prefs.exe, so i can't support them. my program simply calls them for my own convenience. the same disclaimer goes for matlab, octave, pdflatex, firefox, and any other program which flauxtext can or does call. i've opened up the forum on sf.net. https://sourceforge.net/forum/?group_id=137321 i would love to hear your thoughts on anything related to flauxtext. ------------------------------------- Scripting flauxtext, writing plugins ------------------------------------- ------------------------------------- Changes ------------------------------------- have become too numerous to list. ------------------------------------- Report Bugs & Issues ------------------------------------- if you think flauxtext has misbehaved, please check all my documentation to check that it isn't already a "feature" or that i don't yet plan on implementing it as one, and that you have the latest version. all of that information is here: http://fauxlkner.sourceforge.net/ if you've done all that and it's still bothering you, please open the sourcecode through Help > Open my files > Source. comments follow the '#' character and go until the end of the line. just remember to hit F5 before you close it to make sure that you haven't broken it horribly. if you do close it after breaking it, dont' worry! i taught it to save a copy of the source whenever you open it, so you can just overwrite the program's source with the backup! if the backup is broken, you just need to download it again. if you've tried all that and the problem is still bothering you, please post a message on my sf.net forum: https://sourceforge.net/forum/?group_id=137321 if you don't receive a satisfactory prompt reply, please email me at faulkner@users.sf.net with a full description of your problem, and any messages printed to either the screen or the terminal from which you called it.