<?xml version="1.0" encoding="utf-8"?>
<!-- Created by Leo: https://leo-editor.github.io/leo-editor/leo_toc.html -->
<leo_file xmlns:leo="https://leo-editor.github.io/leo-editor/namespaces/leo-python-editor/1.1" >
<leo_header file_format="2"/>
<globals/>
<preferences/>
<find_panel_settings/>
<vnodes>
<v t="ekr.20050315084904"><vh>Startup</vh>
<v t="ekr.20141117135127.2"><vh>@settings</vh>
<v t="ekr.20141117135127.3"><vh>@bool wikiview-active = False</vh></v>
</v>
<v t="ekr.20070325123540"><vh>@chapters</vh></v>
<v t="ekr.20170911061827.1"><vh>@button check .leo files</vh>
<v t="ekr.20170911062209.1"><vh>&lt;&lt; define files &gt;&gt;</vh></v>
</v>
<v t="DSR.20181126072740.2"><vh>@file git_install.py</vh></v>
<v t="ekr.20150416081546.1"><vh>Scripts</vh>
<v t="ekr.20150416081546.2"><vh>Catch mixed newlines in distribution files</vh>
<v t="ekr.20150416081546.3"><vh>check</vh></v>
</v>
<v t="ekr.20150416081546.4"><vh>Catch mixed tab &amp; space in derived files</vh>
<v t="ekr.20150416081546.5"><vh>check</vh></v>
</v>
<v t="ekr.20150416081546.6"><vh>Check all colorizer files for problem regex's</vh></v>
<v t="ekr.20150416081546.7"><vh>Clean ekr-spellpyx.txt</vh></v>
<v t="ekr.20150416081546.8"><vh>Linux install script</vh></v>
<v t="ekr.20150416081546.9"><vh>Warn if leoProjects.txt or leoToDo.txt contain clones</vh></v>
</v>
</v>
<v t="ekr.20161024113526.1"><vh>Notes</vh>
<v t="ekr.20240206185544.1"><vh>Obsolete Notes</vh>
<v t="maphew.20180128212042.1"><vh>Obsolete: How to build Leo's PyPi Package</vh>
<v t="maphew.20180128212042.3"><vh>Create an PyPi.org account</vh></v>
<v t="maphew.20180128212042.2"><vh>Build requirements</vh></v>
<v t="maphew.20180128212042.4"><vh>Build &amp; publish a release</vh></v>
<v t="maphew.20180128213245.1"><vh>Not recommended: Test with TestPyPI</vh></v>
<v t="maphew.20180128212042.5"><vh>Caveats</vh></v>
</v>
<v t="maphew.20200506223713.1"><vh>Obsolete: How to build Leo exe (draft)</vh></v>
<v t="ekr.20101027160251.1500"><vh>Obsolete: NSIS Notes</vh>
<v t="ekr.20101027135430.1492"><vh>@url nsi new ui readme</vh></v>
<v t="ekr.20101027135430.1493"><vh>@url about pages</vh></v>
<v t="ekr.20101027160251.1497"><vh>@url nsDialogs</vh></v>
</v>
<v t="ekr.20101027131034.1490"><vh>Obsolete: NSIS source files</vh>
<v t="ekr.20160510090441.1"><vh>@@file ../../leo_assoc.nsi</vh>
<v t="ekr.20160510090943.1"><vh>&lt;&lt; assoc prolog &gt;&gt;</vh></v>
<v t="ekr.20160510091130.1"><vh>&lt;&lt; assoc pages &gt;&gt;</vh></v>
<v t="ekr.20160510093344.1"><vh>LeoAssoc</vh></v>
<v t="ekr.20160510093411.1"><vh>Section FileAssociation</vh></v>
<v t="ekr.20160510093822.1"><vh>Section Desktop Shortcut</vh></v>
<v t="ekr.20160510093859.1"><vh>Section Start Menu</vh></v>
<v t="ekr.20160510095724.1"><vh>Section Uninstall</vh></v>
<v t="ekr.20160510095711.1"><vh>Section -Post</vh></v>
</v>
<v t="ekr.20101027054254.1590"><vh>@@file ../../leo.nsi</vh>
<v t="ekr.20161017094430.1"><vh>&lt;&lt; defines &gt;&gt;</vh></v>
<v t="ekr.20161017094235.2"><vh>&lt;&lt; prolog &gt;&gt;</vh></v>
<v t="ekr.20161017094235.3"><vh>&lt;&lt; pages &gt;&gt;</vh></v>
<v t="ekr.20161017094235.4"><vh>onInit</vh></v>
<v t="ekr.20161017094235.5"><vh>Section Leo</vh></v>
<v t="ekr.20161017094235.6"><vh>Section File Association</vh></v>
<v t="ekr.20161017094235.7"><vh>Section Desktop Shortcut</vh></v>
<v t="ekr.20161017094235.8"><vh>Section Start Menu</vh></v>
<v t="ekr.20161017094235.9"><vh>Section -Post</vh></v>
<v t="ekr.20161017094235.10"><vh>Section Uninstall</vh></v>
</v>
</v>
<v t="ekr.20100202061222.1494"><vh>Obsolete: SourceForce distribution checklist</vh>
<v t="ekr.20161015091353.2"><vh>Files</vh></v>
<v t="ekr.20161015091353.1"><vh>Web docs</vh></v>
<v t="ekr.20161015091350.1"><vh>Pre-testing</vh></v>
<v t="ekr.20161015092224.1"><vh>Create distribution</vh></v>
<v t="ekr.20161020040946.1"><vh>Test</vh></v>
<v t="ekr.20161020041000.1"><vh>Create git tag</vh></v>
<v t="ekr.20170316104916.1"><vh>Publish release</vh></v>
<v t="ekr.20161015091353.3"><vh>Announcements</vh></v>
<v t="ekr.20180301115911.1"><vh>Create python wheel</vh></v>
<v t="ekr.20150326055410.1"><vh>Update versions</vh></v>
</v>
<v t="ekr.20210815103531.1"><vh>Obsolete: Create pypi distro</vh></v>
<v t="ekr.20161024113542.1"><vh>#106 Homebrew (MacOS) notes</vh>
<v t="ekr.20161025114444.1"><vh>The latest formula</vh></v>
<v t="ekr.20161025114433.1"><vh>Posts</vh>
<v t="ekr.20161024113553.1"><vh>Post 1: Winn Dixie</vh></v>
<v t="ekr.20161024113810.1"><vh>Post 2: ludwigschwardt</vh></v>
<v t="ekr.20161024114150.1"><vh>Post 3: me April 15, 2015</vh></v>
<v t="ekr.20161025091538.1"><vh>Post 4: me April 24, 2015</vh></v>
<v t="ekr.20161025091621.1"><vh>Post 5: ludwidswardt April 24, 2015</vh></v>
<v t="ekr.20161024115114.1"><vh>Post 4: me May 1, 2015</vh></v>
</v>
<v t="ekr.20161024115257.1"><vh>How to compute the sha256 hash</vh></v>
</v>
</v>
<v t="EKR.20040519091259.2"><vh>Quotes of the month</vh>
<v t="ekr.20080901114425.2"><vh>Sept 2008</vh></v>
<v t="ekr.20070425092712"><vh>April 2007</vh></v>
<v t="ekr.20070101093904"><vh>January 2007</vh></v>
<v t="ekr.20060823090437"><vh>August 2006</vh></v>
<v t="ekr.20060213160806"><vh>February 2005</vh></v>
<v t="ekr.20040828084148"><vh>August 2004</vh></v>
<v t="ekr.20040630210818"><vh>July 2004</vh></v>
<v t="EKR.20040519091259.3"><vh>November 2003</vh></v>
<v t="EKR.20040519091259.4"><vh>October 2003</vh></v>
</v>
</v>
<v t="EKR.20040519090846"><vh>Distribution files</vh>
<v t="ekr.20141016105045.2119"><vh>@clean ../../.gitattributes</vh></v>
<v t="EKR.20040519090846.1"><vh>@clean ../../LICENSE</vh></v>
<v t="ekr.20210814054641.1"><vh>@clean ../../MANIFEST.in</vh></v>
<v t="EKR.20040519090846.8"><vh>@clean ../../PKG-INFO.TXT</vh></v>
<v t="EKR.20040519090846.9"><vh>@clean ../../README.md</vh></v>
<v t="maphew.20200424174643.1"><vh>Conda</vh>
<v t="maphew.20200426185115.1"><vh>Outdated Preliminary build recipe</vh></v>
<v t="maphew.20200424174722.1"><vh>@auto ../dist/conda/leo/meta.yaml</vh></v>
</v>
<v t="maphew.20200605112459.1"><vh>Continual Integration</vh>
<v t="matt.20190205105334.1"><vh>@@@clean ../../.travis.yml</vh></v>
<v t="maphew.20200605112532.1"><vh>@@@clean ../../.github/workflows/build-leo-exe.yml</vh></v>
</v>
<v t="mhw.20191107064451.1"><vh>Desktop integration</vh>
<v t="mhw.20191107064521.1"><vh>@clean leo-editor.desktop</vh></v>
</v>
<v t="ekr.20150425135153.1"><vh>homebrew install script</vh>
<v t="ekr.20150425135153.2"><vh>brew install formula</vh></v>
</v>
</v>
<v t="ekr.20180405171433.1" descendentVnodeUnknownAttributes="7d7100285803000000302e3071017d7102580b0000005f5f626f6f6b6d61726b7371037d7104580700000069735f6475706571054930300a73735803000000302e3371067d7107580b0000005f5f626f6f6b6d61726b7371087d7109580700000069735f64757065710a4930300a73735803000000302e35710b7d710c580b0000005f5f626f6f6b6d61726b73710d7d710e580700000069735f64757065710f4930300a73735803000000302e3671107d7111580b0000005f5f626f6f6b6d61726b7371127d7113580700000069735f6475706571144930300a73735803000000302e3871157d7116580b0000005f5f626f6f6b6d61726b7371177d7118580700000069735f6475706571194930300a73735803000000302e39711a7d711b580b0000005f5f626f6f6b6d61726b73711c7d711d580700000069735f64757065711e4930300a73735804000000302e3130711f7d7120580b0000005f5f626f6f6b6d61726b7371217d7122580700000069735f6475706571234930300a73735804000000302e313171247d7125580b0000005f5f626f6f6b6d61726b7371267d7127580700000069735f6475706571284930300a73735804000000302e313271297d712a580b0000005f5f626f6f6b6d61726b73712b7d712c580700000069735f64757065712d4930300a73735804000000302e3134712e7d712f580b0000005f5f626f6f6b6d61726b7371307d7131580700000069735f6475706571324930300a7373752e"><vh>Distribution checklist</vh>
<v t="ekr.20180405171433.4" descendentVnodeUnknownAttributes="7d710058010000003071017d7102580b0000005f5f626f6f6b6d61726b7371037d7104580700000069735f6475706571054930300a7373732e"><vh>Pre-testing (in release branch)</vh></v>
<v t="ekr.20230301070738.1"><vh>LeoSettings.leo</vh></v>
<v t="ekr.20230301070807.1"><vh>LeoPyRef.leo</vh></v>
<v t="ekr.20180405171433.2" descendentVnodeUnknownAttributes="7d710058010000003071017d7102580b0000005f5f626f6f6b6d61726b7371037d7104580700000069735f6475706571054930300a7373732e"><vh>LeoDocs.leo</vh></v>
<v t="ekr.20230301070404.1"><vh>LeoDist.leo</vh></v>
<v t="ekr.20180405171433.3" descendentVnodeUnknownAttributes="7d710058010000003071017d7102580b0000005f5f626f6f6b6d61726b7371037d7104580700000069735f6475706571054930300a7373732e"><vh>Web docs</vh></v>
<v t="ekr.20250730064836.1" descendentVnodeUnknownAttributes="7d710058010000003071017d7102580b0000005f5f626f6f6b6d61726b7371037d7104580700000069735f6475706571054930300a7373732e"><vh>Update version files in release branch</vh></v>
<v t="ekr.20240321104936.1"><vh>Create pypi distro</vh></v>
<v t="ekr.20190618104430.1" descendentVnodeUnknownAttributes="7d710058010000003071017d7102580b0000005f5f626f6f6b6d61726b7371037d7104580700000069735f6475706571054930300a7373732e"><vh>Merge release branch into master</vh></v>
<v t="ekr.20190802115604.1" descendentVnodeUnknownAttributes="7d710058010000003071017d7102580b0000005f5f626f6f6b6d61726b7371037d7104580700000069735f6475706571054930300a7373732e"><vh>After-merge testing in master</vh></v>
<v t="ekr.20180405171433.7" descendentVnodeUnknownAttributes="7d710058010000003071017d7102580b0000005f5f626f6f6b6d61726b7371037d7104580700000069735f6475706571054930300a7373732e"><vh>Create git tag in master</vh></v>
<v t="ekr.20190618104622.1" descendentVnodeUnknownAttributes="7d710058010000003071017d7102580b0000005f5f626f6f6b6d61726b7371037d7104580700000069735f6475706571054930300a7373732e"><vh>Publish release</vh></v>
<v t="ekr.20181001112218.1" descendentVnodeUnknownAttributes="7d710058010000003071017d7102580b0000005f5f626f6f6b6d61726b7371037d7104580700000069735f6475706571054930300a7373732e"><vh>Update version in devel</vh></v>
<v t="ekr.20230301084201.1"><vh>Update this checklist</vh></v>
<v t="ekr.20190618104704.1" descendentVnodeUnknownAttributes="7d710058010000003071017d7102580b0000005f5f626f6f6b6d61726b7371037d7104580700000069735f6475706571054930300a7373732e"><vh>Announcements</vh></v>
</v>
</vnodes>
<tnodes>
<t tx="EKR.20040519090846">@language rest
@wrap
</t>
<t tx="EKR.20040519090846.1" _mod_time="4741da7f9b3a48e6152e">MIT License

Copyright (c) 1997-2026 by Edward K. Ream.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

################
Other Copyrights
################

Portions of Leo's pygments interface use code from the Jupyter qtconsole package.

These parts are are clearly marked in Leo's code as follows:

    Copyright (c) Jupyter Development Team.
    Distributed under the terms of the Modified BSD License.
</t>
<t tx="EKR.20040519090846.8" _mod_time="4741da88007a62a8752e">Metadata-Version: 1.0
Name: leo
Version: 6.8.9
Summary: An IDE, PIM and Outliner. See http://leo-editor.github.io/leo-editor/preface.html.
Description: See users own descriptions of Leo at leo-editor.github.io/leo-editor/testimonials.html.
Home-page: http://leo-editor.github.io/leo-editor/
Author: Edward K. Ream
Author-email: edreamleo@gmail.com
License: MIT
Keywords: Outliner, IDE, PIM, DAG, Scripting
Platform: Windows, Linux, MacOS
Classifier: Development Status :: 6 - Mature
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development
Classifier: Topic :: Text Processing
Download-URL: https://github.com/leo-editor/leo-editor/releases
</t>
<t tx="EKR.20040519090846.9" _mod_time="4741da88007a62a8752e">Leo https://leo-editor.github.io/leo-editor/ 6.8.9 is now available on [GitHub](https://github.com/leo-editor/leo-editor/releases) and [pypi](https://pypi.org/project/leo/).

Leo is an [outline-oriented text editor](https://leo-editor.github.io/leo-editor/preface.html).

**The highlights of Leo 6.8.9**

- Add Find/Change history. How did we ever live without this?
- Replace the ``,,`` Easter Egg with Leo's Find commands.
- Add support for ``@language pug``.
- Enhanced security for Leo's server.
- Significant code-level improvements and performance optimizations.
- Deprecate support for --gui=console.
- The usual bug fixes.

**Links**

- [Install Leo](https://leo-editor.github.io/leo-editor/installing.html)
- [6.8.9 Issues](https://github.com/leo-editor/leo-editor/issues?q=is%3Aissue+milestone%3A6.8.9+)
- [6.8.9 Pull Requests](https://github.com/leo-editor/leo-editor/pulls?q=is%3Apr+milestone%3A6.8.9)
- [Documentation](https://leo-editor.github.io/leo-editor/leo_toc.html)
- [Tutorials](https://leo-editor.github.io/leo-editor/tutorial.html)
- [Video tutorials](https://leo-editor.github.io/leo-editor/screencasts.html)
- [Forum](https://groups.google.com/group/leo-editor)
- [Leo on GitHub](https://github.com/leo-editor/leo-editor)
- [LeoVue](https://github.com/kaleguy/leovue#leo-vue)
- [What people are saying about Leo](https://leo-editor.github.io/leo-editor/testimonials.html)
- [More links](https://leo-editor.github.io/leo-editor/leoLinks.html)
</t>
<t tx="EKR.20040519091259.2"></t>
<t tx="EKR.20040519091259.3">I like Leo more the more I use it...It's an unexpected pleasure to
see my (linearly written) code outlined in Leo. I can't wait to use
Leo to start a new project, going from outline to code...Thanks again
for providing the computing community with such a fine piece of
software. -- Jim Shapiro, Ph.D.

If you think you have used all possible programmer's editors, but
have not yet tried Leo, you are wrong...I rate Leo as a "must have"
for Python programmers. The code makes for a good read.
-- John Tobler  http://weblogs.asp.net/Jtobler/
</t>
<t tx="EKR.20040519091259.4">I've written documentation in WordPerfect, Ventura, Word, PageMaker, and
FrameMaker and even though they create wonderfully looking and useful
documents, they've never been able to do what I've been looking for. HTML,
compiled help files, and later PDF came closer, but still not there. I think
I've found it in LEO, a way to make a "living" document. A document built out
of discrete parts that can be re-organized on the fly to meet the needs of a
varying audience...Being a convert for less than a day I've still got a lot to
learn, but just the possibility of keeping system maintenance scripts in the IT
manual is mind boggling.  -- David Nichols dnichols@amci.com</t>
<t tx="ekr.20040630210818">HTML Editing in Leo is soooo much easier then with NoNodeEditors. I've
had a blast working on a web page. Usually I had to look at a bunch of
gunk all at once. Now I can look at little pieces of gunk! :) 

-Anon (for now)

Before leo, I try to avoid or refactor long functions. With leo, I am
very tempted not to. Being able to view and slice my code at a higher
level in pretty much anyway I want, I feel like a commanding master in
my own mess...Leo lets me be lazy and get away with it. ;)

Mark Ng

[Quote] I have just finished a little embedded system for someone, written in
C using leo as the editor. I told the customer he _had_ to use leo for
ongoing maintenance, after I looked at one of the main state machines:
600 lines in the derived file, but trivially easy to get your head
around in Leo...

The good news is that having been forced to meet leo he thinks it'll
solve many other problems that his company has with code maintenance.
Another step to world domination!

Leo allows you to do things that you'd never consider with another editor. 

BTW: in a real-time embedded system like I was working on, not having
the overhead of a function call (which you'd have had if you'd split
the case statement as you would with a normal editor) saves time, and
makes the system more flexible...
[End Quote]</t>
<t tx="ekr.20040828084148">Leo is the best IDE that I have had the pleasure to use. I have been using it
now for about 2 -- 3 months. It has totally changed not only the way that I
program, but also the way that I store and organize all of the information that
I need for the job that I do. -- Ian Mulvany</t>
<t tx="ekr.20050315084904"></t>
<t tx="ekr.20060213160806">"Thanks for a wonderful program – everybody should be using it! It blows the
socks off that Java Mind mapping software that won project of the month a while
back on sourceforge!" -- Derick van Niekerk.
</t>
<t tx="ekr.20060823090437">Thanks for creating the most useful and amazing application that
I've come across in years. I use Leo every day.</t>
<t tx="ekr.20070101093904">Leo is THE BEST THING to ever had happened to me. I've done in two
weeks what would have taken me years (not exaggerating!). Thanks Ed
for a terrific tool!!!!
 
Julian S. Fecteau 
</t>
<t tx="ekr.20070325123540"></t>
<t tx="ekr.20070425092712">Leo--especially with its feature of user-controllable outlining and
overview--has for the last 4-5 years had the greatest positive effect
on my overall programming quality of life than anything else out there
in the software world (apart maybe from the Python language itself,
and those who contribute Python modules to the world). -- David McNab
</t>
<t tx="ekr.20080901114425.2">For me Squeak and Leo have been two of the most significant technologies to
redefine my personal computer experience and the ideas behind computing.</t>
<t tx="ekr.20100202061222.1494">@language rest

This checklist is obsolete, for the following reasons:

1. There never was a SourceForge release for Leo 5.8.
2. Matt's distribution script creates a more standard way of releasing Leo.</t>
<t tx="ekr.20101027054254.1590">@language nsi

&lt;&lt; defines &gt;&gt;

;;; !include nsi-boilerplate.txt

; RequestExecutionLevel highest
; RequestExecutionLevel admin

&lt;&lt; prolog &gt;&gt;
&lt;&lt; pages &gt;&gt;

; Language should follow pages.
!insertmacro MUI_LANGUAGE "English"

; The order of sections *does* matter slightly.
; It determines the order of items in the components dialog.
; It may also have some other very subtle effects.

@others
</t>
<t tx="ekr.20101027131034.1490">@color
</t>
<t tx="ekr.20101027135430.1492">http://nsis.sourceforge.net/Docs/Modern%20UI%202/Readme.html</t>
<t tx="ekr.20101027135430.1493">http://nsis.sourceforge.net/Docs/Chapter4.html#4.5</t>
<t tx="ekr.20101027160251.1497">http://nsis.sourceforge.net/Docs/nsDialogs/Readme.html</t>
<t tx="ekr.20101027160251.1500"></t>
<t tx="ekr.20141016105045.2119" _mod_time="4741d958732079955b2e"># .gitattributes file for Leo distribution

# Commit this file after changing it!

.gitattributes                  export-ignore
.gitignore                      export-ignore

git-manifest.txt                export-ignore
MakeFile                        export-ignore

leoStandAloneGlobals.py         export-ignore
stand_alone_globals.leo         export-ignore

# Do not include the top-level docs folder in distributions
docs/                           export-ignore
docs/*                          export-ignore

# Do not include various local files.
leo/core/leoPy.leo              export-ignore
leo/core/ekrLeoPy.leo           export-ignore
leo/test/unittest/.leo_shadow/  export-ignore
</t>
<t tx="ekr.20141117135127.2"></t>
<t tx="ekr.20141117135127.3"></t>
<t tx="ekr.20150326055410.1">@language rest

1. Search for ##version

    **Note**: The final version in PKG-INFO.TXT must be called 5.x, not 5.x-final.
    See Pep 440: https://www.python.org/dev/peps/pep-0440/

2. Search for copyright

    Latest copyright date: 2021.

    Note: install.txt file embeds a copyright message in the nsi installer.</t>
<t tx="ekr.20150416081546.1"></t>
<t tx="ekr.20150416081546.2">import glob

@others

verbose = False

# extraFiles = ('..\\install','..\\uninstall','test\\unittest\\perfectImport\\formatter.py',)
extraFiles = () # 'test\\test-line-ending.py',)

baseDir = g.os_path_abspath(g.os_path_join(g.app.loadDir,'..'))
n = 0
dirs = ('','src','scripts','plugins',)
# dirs = ('src',)

if 1:
    for dir2 in dirs:
        theDir = g.os_path_abspath(g.os_path_join(baseDir,dir2))
        print theDir
        files1 = glob.glob('%s\*.py' % theDir)
        files2 = glob.glob('%s\*.leo' % theDir)
        files = files1
        files.extend(files2)
        for name in files:
            f = file(name)
            lines = f.readlines()
            # print '%5d %s' % (len(lines),name)
            f.close()
            check(name,lines)
            n += 1

for z in extraFiles:
    name = g.os_path_abspath(g.os_path_join(baseDir,z))
    f = file(name)
    lines = f.readlines()
    # print '%5d %s' % (len(lines),name)
    f.close()
    check(name,lines)
    n += 1

print 'done.  checked %d files' % (n)
</t>
<t tx="ekr.20150416081546.3">def check(name,lines):

    cr = 0 ; nl = 0

    for s in lines:
       for ch in s:
        if ch == '\r': cr += 1
        if ch == '\n': nl += 1

    if verbose or cr &gt; 0:
        print "%55s %s cr's %4s nl's" % (name,cr,nl)
</t>
<t tx="ekr.20150416081546.4">import glob

@others

baseDir = g.os_path_abspath(g.os_path_join(g.app.loadDir,'..'))
n = 0
for dir2 in ('','src','scripts','plugins',):

    theDir = g.os_path_abspath(g.os_path_join(baseDir,dir2))
    print theDir
    files = glob.glob('%s\*.py' % theDir)
    for name in files:
        f = file(name)
        lines = f.readlines()
        # print '%5d %s' % (len(lines),name)
        f.close()
        check(name,lines)
        n += 1

print 'done.  checked %d files' % (n)
</t>
<t tx="ekr.20150416081546.5">def check(name,lines):

    n = 0
    for line in lines:
        n += 1
        i = g.skip_ws(line,0)
        lws = line[0:i]
        if lws:
            if lws.find(' ') &gt; -1 and lws.find('\t') &gt; -1:
                print '%20s %5d %s' % (name,n,repr(line))
</t>
<t tx="ekr.20150416081546.6">import glob
pattern = g.os_path_finalize_join(g.app.loadDir,'..','modes','*.py')
for fn in glob.glob(pattern):
    sfn = g.shortFileName(fn)
    f = open(fn)
    s = f.read()
    f.close()
    if s.find(r'regexp="\\') &gt; -1:
        g.es(sfn)

@ found: Rules indicated are dubious or broken

md.py:
    [ \t]   leadins: 8,20,24,25(?),50,51
    space   leadins: 23,46,49
    [=-]    leadins: 21,47
    [\\_]   leadins: 54,55
    #       leadins: 22
    other   leadins: 7,12,19,53

moin.py:
    [ \t]           rule 3.
    single-quote    rule 6.

erlang.py:  no obvious problem.
lilypond.py:no obvious problem.
perl.py:    no obvious problem.
pl1.py:     no obvious problem.
rest.py:    no obvious problem.
rtf.py:     no obvious problem.
scala.py:   no obvious problem.
yaml.py:    fixed</t>
<t tx="ekr.20150416081546.7">'''
Regularize newlines in ekr-spellpyx.txt.

Replaces sorts the file, removes duplicate lines and ensuring a trailing newline.
'''
fn = g.os_path_finalize_join(g.app.loadDir,'..','..','ekr-spellpyx.txt')
with open(fn) as f:
    s = ''.join(sorted(set(g.splitLines(f.read().strip()+'\n'))))
with open(fn,'w') as f:
    f.write(s)
</t>
<t tx="ekr.20150416081546.8">@first

"""
A simple script to install Leo on Linux.

Contributed by David McNab &lt;david@rebirthing.co.nz&gt;
"""

import commands,os,sys # commands module is for Unix only.

# We must be root to use this script.
if os.getuid() != 0:
    print "You need to run this install script as root"
    sys.exit(1)

# Create /usr/lib/leo and copy all files there.
print "***** Installing Leo to /usr/lib/leo..."
commands.getoutput("mkdir -p /usr/lib/leo")
commands.getoutput("cp -rp * /usr/lib/leo")

# Create user's 'leo' command script into /usr/bin/leo
print "***** Creating Leo startup script -&gt; /usr/bin/leo"
fd = open("/usr/bin/leo", "w")
fd.write("""#!/usr/bin/python
import commands,sys
files = " ".join(sys.argv[1:])
print commands.getoutput("python /usr/lib/leo/leo.py %s" % files)
""")
fd.close()
commands.getoutput("chmod 755 /usr/bin/leo")
print "***** Leo installed successfully - type 'leo filename.leo' to use it."
</t>
<t tx="ekr.20150416081546.9">@language python

# This script must be run from leoPy.leo.

'''Warn if leoProjects.txt or leoToDo.txt contain any clones.'''

clones,nodes,seen = 0,0,set()
table = (
  '@file ../doc/leoProjects.txt',
  '@file ../doc/leoToDo.txt',
)

def check_clone(c,p0,root):
    '''Warn if p appears in any @&lt;file&gt; node outside of root's tree.'''
    global nodes,seen
    v = p0.v
    for p in c.all_positions():
        nodes += 1
        if p.v == v:
            # Check *all* ancestors, not just the nearest one.
            for parent in p.self_and_parents():
                nodes += 1
                if parent.isAnyAtFileNode() and parent.v != root.v:
                    if parent.v not in seen:
                        seen.add(parent.v)
                        g.es_print('%s and %s contain clone: %s' % (
                            root.h,parent.h,p0.h))

for h in table:
    root = g.findNodeAnywhere(c,h)
    if root:
        for p in root.self_and_subtree():
            nodes += 1
            if p.isCloned():
                clones += 1
                check_clone(c,p,root)
    else:
        g.es_print('not found',h,color='red')
print('done: %s nodes, %s clones' % (nodes,clones))
</t>
<t tx="ekr.20150425135153.1">@language ruby
@tabwidth -2
</t>
<t tx="ekr.20150425135153.2">class Leo &lt; Formula

  homepage "http://leo-editor.github.io/leo-editor/"
  url "http://sourceforge.net/projects/leo/files/Leo/5.0-final/Leo-5.0-final.zip"
  sha256 "2d742f9825959ba5c7624d1179b9f3065e14e055c90272fbce199f91770de826"
  head "https://github.com/leo-editor/leo-editor", :using =&gt; :git

  depends_on "pyqt"
  depends_on "enchant" =&gt; :recommended
  depends_on :python if MacOS.version &lt;= :snow_leopard

  def install
    (lib+"python2.7/site-packages").install "leo"
    bin.install "launchLeo.py" =&gt; "leo" 
  end

  test do
    system bin/"python", "-c", "import leo"
  end
end
</t>
<t tx="ekr.20160510090441.1">@language nsi

;#version # No longer used
!define version         "5.9"

!include MUI2.nsh
!include nsDialogs.nsh
!include LogicLib.nsh

; Globals.
Var PythonDirectory
    ; Directory containing Python.exe
Var PythonExe
    ; "python.exe" or "pythonw.exe"
Var PythonExecutable
    ; $PythonDirectory/$PythonExe

!define app_icon        "leo\Icons\LeoApp.ico"
!define doc_icon        "leo\Icons\LeoDoc.ico"
!define ext             ".leo"
!define leo_hklm        "SOFTWARE\EKR\Leo"
!define license         "LICENSE"
!define name            "Leo"
!define publisher       "Edward K. Ream"
!define site            "https://leo-editor.github.io/leo-editor/"
!define target_file     "LeoAssoc.exe"
!define uninst_key      "Software\Microsoft\Windows\CurrentVersion\Uninstall\leo"

; Locations
Name "Leo Associations"
OutFile "LeoAssoc.exe"
InstallDir "$PROGRAMFILES\Leo-${version}"

; Icons
!define MUI_ICON "${app_icon}"

&lt;&lt; assoc prolog &gt;&gt;
&lt;&lt; assoc pages &gt;&gt;
@others
; Language should follow pages.
!insertmacro MUI_LANGUAGE "English"
</t>
<t tx="ekr.20160510090943.1">

!addincludedir C:\leo.repo\leo-editor\leo\dist

; Boilerplate
SetCompressor bzip2
Caption "Leo File Associations Installer"
AutoCloseWindow false 
SilentInstall normal
CRCCheck on
SetCompress auto
SetDatablockOptimize on
WindowIcon on
ShowInstDetails show
ShowUnInstDetails show
</t>
<t tx="ekr.20160510091130.1">@language nsi

Var StartMenuFolder

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE       ${license}
!insertmacro MUI_PAGE_COMPONENTS

; Define these here so the back button works.
!define MUI_PAGE_HEADER_TEXT "Choose Installed Location"
!define MUI_PAGE_HEADER_SUBTEXT "Choose the folder in which Leo has been installed."
!define MUI_DIRECTORYPAGE_TEXT_TOP "Setup installs file associations for Leo in the Windows registry."
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Select the top-level leo-editor Folder"
!insertmacro MUI_PAGE_DIRECTORY

; It's so easy: just set these *before* creating another directory page!
!define MUI_PAGE_HEADER_TEXT "Choose Python Location"
!define MUI_PAGE_HEADER_SUBTEXT "Select the top-level Python directory"
!define MUI_DIRECTORYPAGE_TEXT_TOP "Choose the top-level Python folder."
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Python Folder"
!define MUI_DIRECTORYPAGE_VARIABLE $PythonDirectory
!insertmacro MUI_PAGE_DIRECTORY

!insertmacro MUI_PAGE_STARTMENU "Application" $StartMenuFolder
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

; ----- uninstaller pages -----

!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_DIRECTORY
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
</t>
<t tx="ekr.20160510093344.1">; The name of this section must be "Leo".
Section "LeoAssoc" SEC01
    ; This section is required, but does not need any contents.
    ; It must have the name of the .exe file.
SectionEnd
</t>
<t tx="ekr.20160510093411.1">Section "${ext} File Association" SEC02
    MessageBox MB_YESNO "Launch Leo in Python console? (recommended for Python 3)" IDYES true IDNO false
    true:
        StrCpy $PythonExe "python.exe"
        goto next
    false:
        StrCpy $PythonExe "pythonw.exe"
    next:
    StrCpy $PythonExecutable "$PythonDirectory\$PythonExe"
        ; Set for all other sections.
    SectionIn 1 2 3 4
    WriteRegStr HKCR "${ext}" "" "Leo File"
    WriteRegStr HKCR "LeoFile" "" "Leo File"
    WriteRegStr HKCR "LeoFile\shell" "" "open"
    ; The single quotes below appear to be required.
    WriteRegStr HKCR "LeoFile\DefaultIcon" "" '"$INSTDIR\${app_icon}"'
        ; https://github.com/leo-editor/leo-editor/issues/24
    WriteRegStr HKCR "LeoFile\shell\open\command" "" '"$PythonExecutable" "$INSTDIR\launchLeo.py %*"'
SectionEnd
</t>
<t tx="ekr.20160510093822.1">
Section "Leo Desktop Shortcut" SEC03
  ; This sets the "Start in folder" box!!!"
  SetOutPath "$INSTDIR\leo"
  ;This is **tricky**.  We need single quotes to handle paths containing spaces.
  ;Add single quotes around PythonExecutable and launchLeo.py args, but *not* the app_icon arg.
  CreateShortCut "$DESKTOP\Leo.lnk" '"$PythonExecutable"' '"$INSTDIR\launchLeo.py"' "$INSTDIR\${app_icon}"
SectionEnd
</t>
<t tx="ekr.20160510093859.1">
Section "Leo Start Menu" SEC04
  ; This is **tricky**.
  ; We need single quotes to handle paths containing spaces.
  ; Add single quotes around PythonExecutable and launchLeo.py args,
  ; but *not* the app_icon arg.
  CreateShortCut "$SMPROGRAMS\Leo\Leo.lnk" '"$PythonExecutable"' '"$INSTDIR\launchLeo.py"' "$INSTDIR\${app_icon}"
  CreateShortCut "$SMPROGRAMS\Leo\Uninstall.lnk" '"$INSTDIR\uninst.exe"'
SectionEnd
</t>
<t tx="ekr.20160510095711.1">
Section -Post
  WriteRegStr HKLM ${leo_hklm} "" "$INSTDIR"
  WriteUninstaller "$INSTDIR\uninst.exe"
  WriteRegStr HKLM "${uninst_key}" "DisplayName" "Leo File Associations (remove only)"
  WriteRegStr HKLM "${uninst_key}" "UninstallString" "$INSTDIR\uninst.exe"
  WriteRegStr HKLM "${uninst_key}" "DisplayVersion" "Leo File Associations"
  WriteRegStr HKLM "${uninst_key}" "URLInfoAbout" "${site}"
  WriteRegStr HKLM "${uninst_key}" "Publisher" "${publisher}"
SectionEnd
</t>
<t tx="ekr.20160510095724.1">
Section Uninstall
    DeleteRegKey HKLM "${leo_hklm}"
    DeleteRegKey HKCR "${ext}"
    DeleteRegKey HKCR "LeoFile"
    ; Remove links.
    Delete "$SMPROGRAMS\Leo\Uninstall.lnk"
    Delete "$SMPROGRAMS\Leo.lnk"
    Delete "$DESKTOP\Leo.lnk"
    DeleteRegKey HKLM "${uninst_key}" 
    SetAutoClose false

SectionEnd ; end Uninstall section
</t>
<t tx="ekr.20161015091350.1">- Make sure no distributed .leo file contains xml-stylesheet elements.
  Run @button check .leo files in leo-dist.leo.
- Make sure Leo looks good without myLeoSettings.leo.
- Run the "check-bindings" button in leoSettings.leo.
- Run all unit tests with *both* Python 2 and 3.
- Run ll -a with *both* Python 2 and 3.</t>
<t tx="ekr.20161015091353.1">- Regenerate all .html files.
- Copy files to web, including leo/doc/html/index.html
  Do **not** copy searchindex.js.
</t>
<t tx="ekr.20161015091353.2">LeoDocs.leo:
- Make sure copyright dates are correct.
- Update the "last updated" text in index.html.
- Update version numbers in html/conf.py
- Update the release notes.
- Remove @language rest where possible in new notes.
- Create new "what's new" section.
- Remove top-level clones.
- Spell check entire file.
- Copy release notes to leoDist.leo.
- Copy release notes to LeoReleaseNotes.leo
- Select the readme node.

LeoDist.leo:
- Make sure copyright dates are correct.
- Update version numbers: search leoDist.leo for ##version.
- Update readme.md.
- Check readme.md spelling.
- Check 'PKG-INFO.TXT'

leoVersion.py:
- Update version constant.

LeoPyRef.leo and LeoPluginsRef.leo:
- Regenerate from corresponding local file.
- Remove top-level clones.
</t>
<t tx="ekr.20161015091353.3">- Update the *GitHub* release at https://github.com/leo-editor/leo-editor/releases
   This must be done *soon* after the release's actual commit.
   There is a "Draft New Release" button at the top-right of the page.

- Update version number on Leo's wikipedia site:
  http://en.wikipedia.org/wiki/Leo_%28editor%29
  - Edit with the 'Edit this page' *tab* (not a link)
  - Update version number on web site.

- Announce to SourceForge:  http://sourceforge.net/projects/leo/
   **Markdown accepted, so paste release notes in LeoDocs.leo.**.

- Announce to leo-editor: **Paste source-forge announcement**.

- Announce to Python-announce-list using email:
   mailto:python-announce-list@python.org
   **Paste source-forge or leo-editor announcement**.

  - Check it by visiting the archive:
  https://mail.python.org/pipermail/python-announce-list/

- Register Leo at https://pypi.python.org/pypi/leo

- My blog: http://edreamleo.blogspot.com/
  **Paste source-forge or leo-editor announcement**.
  **To get HTML, just use html tab**.
</t>
<t tx="ekr.20161015092224.1">Run make-leo.
- Commit all files before running make-leo.
- Run make-leo button in leoDist.leo.
- Commit any changed files.
- If any files change, rerun make-leo.

Create the executable installer:
- Double-click leo.nsi. (Run with makeNSIS.exe)

Run pyinstaller on Windows:
- Delete leo-editor/dist and leo-editor/build folders.
- Run [a32]&gt; pyinstaller --clean --win-private-assemblies launchLeo-unified.spec
- Test a *copy* of the result so .pyo files are not added to the package)
- Rename leo/dist/LeoAppFolder to LeoApp (fixes windows naming problem).
- Compress the LeoApp folder to Leo_&lt;version&gt;_Win.zip.
    
Run pyinstaller on Linux:
- (optional) Delete leo-editor/dist and leo-editor/build folders.
- Run pyinstaller2 launchLeo-unified.spec
- Test a *copy* of the result so .pyo files are not added to the package)
- Compress the folder to Leo_&lt;version&gt;_Linux_64_bit.tar.gz.
</t>
<t tx="ekr.20161017094235.10">
Section Uninstall

    DeleteRegKey HKLM "${leo_hklm}"
    DeleteRegKey HKCR "${ext}"
    DeleteRegKey HKCR "${name}File"
    ; Safely removes all files and directories, including $INSTDIR.
    ; The make-leo button creates nsi-uninstall-files.txt.
    !include nsi-uninstall-files.txt
    ; Remove links.
    Delete "$SMPROGRAMS\${name}\Uninstall.lnk"
    Delete "$SMPROGRAMS\${name}.lnk"
    ; RMDir  "$SMPROGRAMS\${name}-${version}"
    RMDir  "$SMPROGRAMS\${name}"
    Delete "$DESKTOP\${name}.lnk"
    DeleteRegKey HKLM "${uninst_key}" 
    SetAutoClose false

SectionEnd ; end Uninstall section
</t>
<t tx="ekr.20161017094235.2">; Globals.
Var PythonDirectory
    ; Directory containing Pythonw.exe
    ; Set by onInit.  May be set in Python Directory page.

!define PythonExecutable "$PythonDirectory\pythonw.exe"
    ;;; Always use pythonw.exe here.
    ;;; To debug, set the target to python.exe in the desktop icon properties.

!addincludedir C:\leo.repo\leo-editor\leo\dist

; Boilerplate
SetCompressor bzip2
Caption "${name}-${version} Installer"
AutoCloseWindow false 
SilentInstall normal
CRCCheck on
SetCompress auto
SetDatablockOptimize on
WindowIcon on
ShowInstDetails show
ShowUnInstDetails show

; Locations
Name "${name}"
OutFile "${target_file}"
InstallDir "$PROGRAMFILES\${name}-${version}"

; Icons
!define MUI_ICON "${app_icon}"
</t>
<t tx="ekr.20161017094235.3">@language nsi

Var StartMenuFolder

; Define the TEXT_TOP for both the MUI_PAGE_DIRECTORY pages.
; "${s1a} ${s2} ${s3}" is the TEXT_TOP for the Install Location page.
; "${s2b} ${s2} ${s3}" is the TEXT_TOP for the Choose Python Folder page.
!define s1a "Setup will install ${name} in the following folder."
!define s1b "Setup will use the following folder as the Python location."
!define s2 "To install in a different folder, click Browse and select another folder."
!define s3 "Click next to continue."

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE       ${license}
!insertmacro MUI_PAGE_COMPONENTS

; These are the defaults, but defined them here so the back button works.
!define MUI_PAGE_HEADER_TEXT "Choose Install Location"
!define MUI_PAGE_HEADER_SUBTEXT "Choose the folder in which to install ${name}"
!define MUI_DIRECTORYPAGE_TEXT_TOP "${s1a} ${s2} ${s3}"
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Destination Folder"
!insertmacro MUI_PAGE_DIRECTORY

; It's so easy: just set these *before* creating another directory page!
!define MUI_PAGE_HEADER_TEXT "Choose Python Location"
!define MUI_PAGE_HEADER_SUBTEXT "Select the top-level Python directory"
!define MUI_DIRECTORYPAGE_TEXT_TOP "${s1b} ${s2} ${s3}"
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Python Folder"
!define MUI_DIRECTORYPAGE_VARIABLE $PythonDirectory
!insertmacro MUI_PAGE_DIRECTORY

!insertmacro MUI_PAGE_STARTMENU     "Application" $StartMenuFolder
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

; ----- uninstaller pages -----

!insertmacro MUI_UNPAGE_WELCOME
; !insertmacro MUI_UNPAGE_LICENSE   ${license}
; !insertmacro MUI_UNPAGE_CONFIRM
; !insertmacro MUI_UNPAGE_COMPONENTS ; doesn't actually list components.
!insertmacro MUI_UNPAGE_DIRECTORY
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
</t>
<t tx="ekr.20161017094235.4">
; Set PythonDirectory to the top-level Python path.
; For now, prefer Python 2.x to Python 3.x.
Function .onInit
    ;try27:
        SetRegView 64
        ReadRegStr $9 HKLM Software\Python\PythonCore\2.7\InstallPath ""
        StrCmp $9 "" try26 ok
    try26:
        ReadRegStr $9 HKLM SOFTWARE\Python\PythonCore\2.6\InstallPath ""
        StrCmp $9 "" try35 ok
    try35:
        ReadRegStr $9 HKLM Software\Python\PythonCore\3.5\InstallPath ""
        StrCmp $9 "" try34 ok
    try34:
        ReadRegStr $9 HKLM Software\Python\PythonCore\3.4\InstallPath ""
        StrCmp $9 "" try33 ok
    try33:
        ReadRegStr $9 HKLM Software\Python\PythonCore\3.3\InstallPath ""
        StrCmp $9 "" try32 ok
    try32:
        ReadRegStr $9 HKLM Software\Python\PythonCore\3.2\InstallPath ""
        StrCmp $9 "" try31 ok
    try31:
        ReadRegStr $9 HKLM Software\Python\PythonCore\3.1\InstallPath ""
        StrCmp $9 "" try30 ok
    try30:
        ReadRegStr $9 HKLM Software\Python\PythonCore\3.0\InstallPath ""
        StrCmp $9 "" tryReg32 ok
    ; Entries not found in 64-bit registry: try 32-bit registry...
    tryReg32:
        SetRegView 32
        ReadRegStr $9 HKLM Software\Python\PythonCore\2.7\InstallPath ""
        StrCmp $9 "" try26_32 ok
    try26_32:
        ReadRegStr $9 HKLM Software\Python\PythonCore\2.6\InstallPath ""
        StrCmp $9 "" try35_32 ok
    try35_32:
        ReadRegStr $9 HKLM Software\Python\PythonCore\3.5\InstallPath ""
        StrCmp $9 "" try34_32 ok
    try34_32:
        ReadRegStr $9 HKLM Software\Python\PythonCore\3.4\InstallPath ""
        StrCmp $9 "" try33_32 ok
    try33_32:
        ReadRegStr $9 HKLM Software\Python\PythonCore\3.3\InstallPath ""
        StrCmp $9 "" try32_32 ok
    try32_32:
        ReadRegStr $9 HKLM Software\Python\PythonCore\3.2\InstallPath ""
        StrCmp $9 "" try31_32 ok
    try31_32:
        ReadRegStr $9 HKLM Software\Python\PythonCore\3.1\InstallPath ""
        StrCmp $9 "" try30_32 ok
    try30_32:
        ReadRegStr $9 HKLM Software\Python\PythonCore\3.0\InstallPath ""
        StrCmp $9 "" oops ok
    oops:
        MessageBox MB_OK "Python not found"
        StrCpy $PythonDirectory ""
        Goto done
    ok:
        StrCpy $PythonDirectory $9
    done:
FunctionEnd ; End .onInit
</t>
<t tx="ekr.20161017094235.5">
; The name of this section must be "Leo".
Section "Leo" SEC01
    ; Add all files and directories.
    ; The make-leo button creates nsi-install-files.txt.
    !include nsi-install-files.txt
SectionEnd
</t>
<t tx="ekr.20161017094235.6">
Section "${ext} File Association" SEC02
    SectionIn 1 2 3 4
    WriteRegStr HKCR "${ext}" "" "${name}File"
    WriteRegStr HKCR "${name}File" "" "${name} File"
    WriteRegStr HKCR "${name}File\shell" "" "open"
    ; The single quotes below appear to be required.
    WriteRegStr HKCR "${name}File\DefaultIcon" "" '"$INSTDIR\${app_icon}"'
    ; https://github.com/leo-editor/leo-editor/issues/24
    WriteRegStr HKCR "${name}File\shell\open\command" "" '"${PythonExecutable}" "$INSTDIR\launchLeo.py %*"'
SectionEnd
</t>
<t tx="ekr.20161017094235.7">
Section "${name} Desktop Shortcut" SEC03
  ; This sets the "Start in folder" box!!!"
  SetOutPath "$INSTDIR\leo"
  ;;; This is **tricky**.  We need single quotes to handle paths containing spaces.
  ;;; Add single quotes around PythonExecutable and launchLeo.py args, but *not* the app_icon arg.
  CreateShortCut "$DESKTOP\${name}.lnk" '"${PythonExecutable}"' '"$INSTDIR\launchLeo.py"' "$INSTDIR\${app_icon}"
SectionEnd
</t>
<t tx="ekr.20161017094235.8">
Section "${name} Start Menu" SEC04
  CreateDirectory "$SMPROGRAMS\${name}"
  ;;; This is **tricky**.  We need single quotes to handle paths containing spaces.
  ;;; Add single quotes around PythonExecutable and launchLeo.py args, but *not* the app_icon arg.
  CreateShortCut "$SMPROGRAMS\${name}\${name}.lnk" '"${PythonExecutable}"' '"$INSTDIR\launchLeo.py"' "$INSTDIR\${app_icon}"
  CreateShortCut "$SMPROGRAMS\${name}\Uninstall.lnk" '"$INSTDIR\uninst.exe"'
SectionEnd
</t>
<t tx="ekr.20161017094235.9">
Section -Post
  WriteRegStr HKLM ${leo_hklm} "" "$INSTDIR"
  WriteUninstaller "$INSTDIR\uninst.exe"
  WriteRegStr HKLM "${uninst_key}" "DisplayName" "${name}-${version} (remove only)"
  WriteRegStr HKLM "${uninst_key}" "UninstallString" "$INSTDIR\uninst.exe"
  WriteRegStr HKLM "${uninst_key}" "DisplayVersion" "${version}"
  WriteRegStr HKLM "${uninst_key}" "URLInfoAbout" "${site}"
  WriteRegStr HKLM "${uninst_key}" "Publisher" "${publisher}"
SectionEnd
</t>
<t tx="ekr.20161017094430.1">;;; This doesn't work.
;;; !addincludedir C:\leo.repo\leo-editor\leo\dist

!include MUI2.nsh
!include nsDialogs.nsh
!include LogicLib.nsh

;#version
!define version         "5.9"

; These are *not* Python strings--backslashes are fine.

!define app_icon        "leo\Icons\LeoApp.ico"
!define doc_icon        "leo\Icons\LeoDoc.ico"
; This works, but the icon is too small.
;!define icon            "C:\leo.repo\trunk\leo\Icons\SplashScreen.ico"
!define ext             ".leo"
!define leo_hklm        "SOFTWARE\EKR\Leo"
!define license         "LICENSE"
!define name            "Leo"
!define publisher       "Edward K. Ream"
!define site            "https://leo-editor.github.io/leo-editor/"
!define target_file     "LeoSetup-${version}.exe"
!define uninst_key      "Software\Microsoft\Windows\CurrentVersion\Uninstall\leo"
</t>
<t tx="ekr.20161020040946.1">Test files in installed folder:

- Run all unit tests in the installed folder, with the installed Leo.

- Make sure the following open without errors:
    - leoPlugins.leo
    - leoPy.leo
    - LeoDocs.leo
</t>
<t tx="ekr.20161020041000.1">- Create a full (annotated) tag:
  - Do not use the -f option.
  - Make sure the tag does not conflict with the release branch.
    Release *branches* should end with "-rel"
    Tags should start with "v".
    Tags should *not* end with "-rel"

git tag -a v5.9.x -m "Added v5.9.x tag"
git push --follow-tags
</t>
<t tx="ekr.20161024113526.1">@language rest
@wrap

See LeoDocs.leo for all previous release notes.</t>
<t tx="ekr.20161024113542.1">@language rest
@wrap

https://github.com/leo-editor/leo-editor/issues/106

How to Create and Maintain a Tap
https://github.com/Homebrew/brew/blob/master/docs/How-to-Create-and-Maintain-a-Tap.md

How To Open a Homebrew Pull Request (and get it merged)
https://github.com/Homebrew/brew/blob/master/docs/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md
</t>
<t tx="ekr.20161024113553.1">From: Winn Dixie incredible0n3@gmail.com

Would be stellar to have a brew install leo. http://brew.sh/

Homebrew formulae are simple Ruby scripts::

require "formula"

class Wget &lt; Formula
  homepage "http://www.gnu.org/software/wget/"
  url "http://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz"
  sha1 "f3c925f19dfe5ed386daae4f339175c108c50574"

  def install
    system "./configure", "--prefix=#{prefix}"
    system "make", "install"
  end
end

To install homebrew, paste this in a terminal::

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

The script explains what it will do and then pauses before it does it.
</t>
<t tx="ekr.20161024113810.1">https://github.com/ludwigschwardt

I've made a first draft of this many moons ago (1 Oct 2013, to be exact :-)).

It still installs Leo 4.10 final. That is if it still works, as I haven't tested it in a while...

You can try it out like this from my tap:

brew tap ska-sa/tap
brew install leo

You are more than welcome to copy it from [here](https://github.com/ska-sa/homebrew-tap/blob/master/leo.rb) and tinker with it.
</t>
<t tx="ekr.20161024114150.1">Whew. Added this pull request: https://github.com/Homebrew/legacy-homebrew/pull/38980
We'll see what happens...

Here is the updated leo.rb file that passes brew audit --strict Leo:

@language ruby

class Leo &lt; Formula
  homepage "http://leo-editor.github.io/leo-editor/"
  url "https://downloads.sourceforge.net/projects/leo/files/Leo/5.1-final/Leo-5.1-final.zip"
  sha256 "2d742f9825959ba5c7624d1179b9f3065e14e055c90272fbce199f91770de826"

  depends_on "pyqt"
  depends_on "enchant" =&gt; :recommended

  def install
    # Obtain information on Python installation
    python_xy = "python" + `%x(python -c "import sys;print(sys.version[:3])")`.chomp
    python_site_packages = lib + "#{python_xy}/site-packages"
    python_site_packages.install "leo"
    bin.install ["launchLeo.py", "profileLeo.py"]
    ln_s "#{bin}/launchLeo.py", "#{bin}/leo"
  end

  test do
    # Create, run in and delete a temporary directory.
    if system "python" "-c" "import leo"
      onoe "Leo FAILED"
    else
      ohai "Leo OK"
    end
  end
end

@language rest

It took quite awhile to grok what was going on. Here are my notes:

brew update
  # updates formulae.
brew doctor
# Clone homebrew into ~/leo.repo/homebrew
cd ~/leo.repo
git clone https://github.com/leo-editor/homebrew.git
brew create http://sourceforge.net/projects/leo/files/Leo/5.1-final/Leo-5.1-final.zip
    # This Downloaded the file and opened vim:
    # ==&gt; Downloading http://sourceforge.net/projects/leo/files/Leo/5.1-final/Leo-5.1-
    # The second time I did this I simply replaced the file with the proper leo.rb.
brew audit --strict Leo
  # Caught various problems.
cd homebrew
  # Not part of the instructions.
git checkout -b Leo
  # Switched to a new branch 'Homebrew-Leo'
git add Library/Formula/leo.rb
  # Not part of the instructions.
git commit Library/Formula/leo.rb ### &amp;&amp; git push
git push
  # (within SourceTree) using my normal GitHub username and password.

</t>
<t tx="ekr.20161024115114.1">Here is the latest leo.rb:

@language ruby

class Leo &lt; Formula
  homepage "http://leo-editor.github.io/leo-editor/"
  url "http://sourceforge.net/projects/leo/files/Leo/5.0-final/Leo-5.0-final.zip"
  sha256 "2d742f9825959ba5c7624d1179b9f3065e14e055c90272fbce199f91770de826"
  head "https://github.com/leo-editor/leo-editor", :using =&gt; :git

  depends_on "pyqt"
  depends_on "enchant" =&gt; :recommended
  depends_on :python if MacOS.version &lt;= :snow_leopard

  def install
    (lib+"python2.7/site-packages").install "leo"
    bin.install "launchLeo.py" =&gt; "leo"
  end

  test do
    system bin/"python", "-c", "import leo"
  end
end

@language rest


This passes the following::

    brew audit --strict Leo
    brew install --verbose --debug Leo

However, after:

    brew uninstall Leo
    brew install Leo

I get the following:

    sh: -c: line 0: syntax error near unexpected token `python'
    sh: -c: line 0: `%x(python -c "import sys;print(sys.version[:3])")'

This looks like an old version of leo.rb is being used, but a thorough
search shows no such file. Any help would be appreciated.</t>
<t tx="ekr.20161024115257.1">*Note*: Brew create now computes the hash automatically.

http://stackoverflow.com/questions/32673943/how-to-update-homebrew-sha256

After editing the formula, you can run:

    brew fetch your-formula --build-from-source

to fetch the tarball and display the new checksum.

If you've already downloaded the tarball somewhere, you can calculate the hash with:

    openssl sha256 &lt; some_tarball.tar.gz

or:

    shasum -a 256 some_tarball.tar.gz
</t>
<t tx="ekr.20161025091538.1">Here, I'd like to add to the previous post, to show the big picture. Creating a pull request is actually pretty simple, as the homebrew readme suggests:

1. Fork Homebrew.
2. brew create http://example.com/foo-0.1.tar.gz
3. git checkout -b foo
4. git commit Library/Formula/foo.rb &amp;&amp; git push
5. Pull Request: links to https://github.com/Homebrew/homebrew/pulls

This kind of abbreviated list strikes a good balance for those who know the big picture. But for those who don't, a few more details would be helpful:

Directories

The instructions don't mention directories, which was confusing:

    I forked homebrew in ~/leo.repo, my standard place for repos. This created all kinds of stuff in /usr/local, but those places don't matter. Everything actually should happen in ~/leo.repo/homebrew. It took me awhile to realize I could ignore everything in /usr/local.

    Steps 2, 3 and 4 happened, iirc, in ~/leo.repo or in ~/leo.repo/homebrew, which, in retrospect, makes sense, but did not at the time.

Pushing &amp; the pull request

The following may be blindingly obvious to those with more experience with git, but this was the first time I had used git in a more collaborative way:

    The push happens in my fork, so I can (must) use my own GitHub credentials to do the push. I'm simply modifying my own fork.
    The link in the step 5, pull request, isn't really helpful. Instead, after the push, a button in my fork of homebrew appeared called something like "submit pull request". I pressed the button, added a few comments, and off we went. Next time, I'll add a link to Leo's home page. The email link was redundant, but it may have encouraged the helpful comments that I received...

Changing the pull request

The first pull request had problems, so I assume it won't be pulled. I also assume that I can simply make the changes in leo.rb in my already existing branch, push them, and then issue a new pull request.

Summary: This is actually a straightforward process, but nobody knows better than I that describing a straightforward process is anything but straightforward!
</t>
<t tx="ekr.20161025091621.1">he Formula Cookbook, https://github.com/Homebrew/brew/blob/master/docs/Formula-Cookbook.md, is a must-read, especially the Python-related parts!)

These instructions for contributing to Homebrew (specifically calling brew commands) assume that you are actually *using* Homebrew, and normally the Homebrew repo then lives in /usr/local. I normally work in that repo and would then copy the formula elsewhere for pushing (typically to my tap repo).

You don't have to issue a new pull request. Just add your changes to the same branch and push them, and they will remain associated with the same pull request. This is a great feature of the PR: you can commit and discuss until everyone is happy and the PR then gets accepted.

I would rename the pull request "leo 5.1 (new formula)". :-)
</t>
<t tx="ekr.20161025114433.1"></t>
<t tx="ekr.20161025114444.1">@language ruby

class LeoEditor &lt; Formula
  desc "The Leo IDE/Outliner/PIM"
  homepage "http://leo-editor.github.io/leo-editor/"
  url "https://github.com/leo-editor/leo-editor/archive/5.4.1.tar.gz"
  sha256 "2cf0f598aa46e8ced6dd7da0229157e7b523704d0a03604a4da14b715c0a232f"

  depends_on :python if MacOS.version &lt;= :snow_leopard
  depends_on "pyqt"
  depends_on "enchant" =&gt; :recommended

  def install
    bin.install "leo"
    bin.install ["launchLeo.py", "profileLeo.py"]
    ln_s "#{bin}/launchLeo.py", "#{bin}/leo"
  end

  test do
    if system "python", "-c", "import", "leo"
      onoe "Leo FAILED"
    else
      ohai "Leo OK"
    end
  end
end</t>
<t tx="ekr.20170316104916.1">- Create Release on SourceForge: http://sourceforge.net/projects/leo/
    - Make sure to upload readme.md and Readme-quick-install.txt.
</t>
<t tx="ekr.20170911061827.1">'''Make sure no distributed .leo file contains xml-stylesheet elements.'''
# g.cls()
&lt;&lt; define files &gt;&gt;
for fn in files:
    path = g.os_path_finalize_join(g.app.loadDir, '..', fn)
    if g.os_path_exists(path):
        with open(path, 'rb') as f:
            s = f.read()
        s = g.toUnicode(s)
        if s.find('&lt;xml-stylesheet') &gt; -1:
            g.es_print('contains xml-stylesheet element: %s' % (path))
    else:
        g.es_print('does not exist: %s' % path)
g.es_print('done')
</t>
<t tx="ekr.20170911062209.1">files = (
    'config/exampleSettings.leo',
    'config/leoSettings.leo',
    'core/leoPyRef.leo',
    'dist/leoDist.leo',
    'doc/LeoReleaseNotes.leo',
    'doc/cheatSheet.leo',
    'doc/default_workbook.leo',
    'doc/leoDocs.leo',
    'doc/leoSlideShows.leo',
    'doc/quickstart.leo',
    'external/leo2html.leo',
    'plugins/leoGuiPluginsRef.leo',
    'scripts/scripts.leo',
    'test/test.leo',
)</t>
<t tx="ekr.20180301115911.1">- git checkout {release-tag}
- python setup.py bdist_wheel
- twine upload dist/leo*.whl
</t>
<t tx="ekr.20180405171433.1">Overview

Create the **release branch**: 6.8.10.
Change version in this checklist to match.

It's ok to merge devel into release branch
*unless* devel contains work for the *next* release.

@language rest
</t>
<t tx="ekr.20180405171433.2" __bookmarks="7d7100580700000069735f6475706571014930300a732e">- Make sure copyright dates are correct.
- Update the version numbers in index.html and conf.py:
  Search for 6.8.
- Update the release notes. *Make sure to update links*.
- Create new "what's new" section.
- Remove top-level clones.
- Spell check entire file, starting at the "Web pages" node.
- Copy release notes to leoDist.leo, the node `@clean ../../README.md`.
- Copy release notes to LeoReleaseNotes.leo
</t>
<t tx="ekr.20180405171433.3" __bookmarks="7d7100580700000069735f6475706571014930300a732e">- git checkout `gh-pages`.
- git merge 6.8.10
- Run the `find-bad-links` script and fix any errors
- Run the `make-sphinx` from LeoDocs.leo
  This script copies files from leo/doc/html/_build/html to leo-editor/docs
- Commit the changes and push.
- Check the GitHub Pages actions page:
  https://github.com/leo-editor/leo-editor/actions
- Check Leo's website.
</t>
<t tx="ekr.20180405171433.4" __bookmarks="7d7100580700000069735f6475706571014930300a732e">- Run The update_leo_tools.py script *first*.

- leoGlobals.py: &lt;&lt; leoGlobals: global constants &gt;&gt;
  Check minimum_python_version and minimum_python_version_tuple.

- Make sure Leo looks good without myLeoSettings.leo.

- Make sure Leo runs with Python 3.10.

- Run the full-test-leo script. See #2867:
  https://github.com/leo-editor/leo-editor/issues/2867

- Test on Linux.</t>
<t tx="ekr.20180405171433.7" __bookmarks="7d7100580700000069735f6475706571014930300a732e">Create a git tag **last**

git checkout master
git tag -a v6.8.10 -m "Added v6.8.10 tag"
git push --follow-tags
</t>
<t tx="ekr.20181001112218.1" __bookmarks="7d7100580700000069735f6475706571014930300a732e">- git checkout devel
- git merge master
- update version in leoVersion.py.
</t>
<t tx="ekr.20190618104430.1" __bookmarks="7d7100580700000069735f6475706571014930300a732e">From 6.8.10 branch:

- git merge master
- Fix any conflicts and push.
- git checkout master
- git merge 6.8.10</t>
<t tx="ekr.20190618104622.1" __bookmarks="7d7100580700000069735f6475706571014930300a732e">Update the *GitHub* release at https://github.com/leo-editor/leo-editor/releases

This must be done *soon* after the release's actual commit.
There is a "Draft New Release" button at the top-right of the page.
</t>
<t tx="ekr.20190618104704.1" __bookmarks="7d7100580700000069735f6475706571014930300a732e">- Announce to leo-editor first.

Public announcements, after creating a package.

- Announce to SourceForge:  http://sourceforge.net/projects/leo/
   **Markdown accepted, so paste release notes in LeoDocs.leo.**.

- Announce to Python-announce-list using email:
   python-announce-list@python.org
   **Paste source-forge or leo-editor announcement**.
   
   To make it easier to include your announcement on www.python.org's front page,
   please include 2-3 lines of HTML code at the very end of your submission,
   using the following template:

    &lt;P&gt;&lt;A HREF="https://leo-editor.github.io/leo-editor/"&gt;Leo 6.8.9&lt;/A&gt;
    Leo 6.8.9 released (11-8-2024)


  - Check it by visiting the archive:
    https://mail.python.org/archives/list/python-announce-list@python.org/
  
- My blog: http://edreamleo.blogspot.com/
  **Paste GitHub announcement**.
</t>
<t tx="ekr.20190802115604.1" __bookmarks="7d7100580700000069735f6475706571014930300a732e">- git checkout master
- full-test-leo
</t>
<t tx="ekr.20210814054641.1" _mod_time="4741da5a5ae8fea4c22e">@language unknown_language

# Order matters!

# Include *everything* in the leo folder.
graft leo

global-exclude *.py[cod] *.__pycache__ *.so
global-exclude *mypy_cache *.mypy_cache, *.mypy_stubs, *.gitattributes, *.htmlcov

# Add files in the top-level leo-editor folder.

include *.py
include *.TXT

# No longer required.
# obscure pip bug fix https://github.com/pypa/setuptools/issues/1694
#include pyproject.toml

# Tweaks

prune leo/unittests/htmlcov
prune leo/doc/html
include leo/doc/html/conf.py

# #3853.
include leo/doc/_static
</t>
<t tx="ekr.20210815103531.1">**build**

- git checkout master
- Delete files in leoeditor/dist
- python -m build

**upload**

- ***Disable VPN***

python -m twine upload -r pypi dist/*

username:  __token__
password:  EKR: Copy contents of leo_pypi_token.txt
           Then paste using "Paste" from console Edit menu.
           
File names must be unique.
If there are conflicting names, add -NNN to the filename, like this:
    leo-6.7.8-2-py3-none-any.whl
    leo-6.7.8-2.tar.gz

**install**

- Remove leo-editor from sitecustomize.py if it exists.

python -m pip install --index-url https://pypi.org/simple/ --no-deps leo==6.7.8

**test**

cd ~  # Anywhere except leo-editor folder!
python -m leo.core.runLeo

**uninstall after testing**

python -m pip uninstall leo

-restore sitecustomize.py if necessary.
</t>
<t tx="ekr.20230301070404.1">LeoDist.leo:
- Make sure copyright dates are correct.
- Update version numbers. Search for 6.8.x
  The final version in PKG-INFO.TXT must be called 6.8.10, not 6.8.10-final.
  See Pep 440: https://www.python.org/dev/peps/pep-0440/
- Update readme.md.
- Update version in 'PKG-INFO.TXT'
- Check readme.md spelling.
- Make sure no distributed .leo file contains xml-stylesheet elements.
  Run @button check .leo files in leoDist.leo.
</t>
<t tx="ekr.20230301070738.1">- Run all "check" buttons in leoSettings.leo.

</t>
<t tx="ekr.20230301070807.1">Do *not* use the (disabled) write-LeoPyRef button in LeoPy.leo. It is buggy.

- Create LeoPyRef.leo by copying leoPy.leo to it, then deleting unwanted nodes.
- Open LeoPyRef.leo. Verify the diff after saving.
- Run the the check button.</t>
<t tx="ekr.20230301084201.1">- Change 6.8.10 (the old version) to 6.8.11.
  Be careful about the new version in this node!
</t>
<t tx="ekr.20240206185544.1"></t>
<t tx="ekr.20240321104936.1">.. How to create pypi distributions:
.. https://github.com/leo-editor/leo-editor/issues/3837

*Note*: All scripts mentioned below are *Python* scripts in leo/scripts.

This checklist may seem daunting. In most cases errors are harmless, so don't despair.

Step 1: Create and test the distribution files in leo/dist:

- Do *not* change `PKG-INFO.TXT` if there are problems with file name in later steps!
- Run the `build_leo` script to create `.whl` and `.tar.gz` files in the leo/dist directory.
  - Ignore warnings like `no previously-included files matching...`.
  - Make sure the filenames are as expected!
- *** Delete the `leo-editor/leo.egg-info` directory!
- (Optional) Run the `inspect_wheel` script to inspect the metadata in the `.whl` file.

Step 2: Install locally and test:

Everything, including filenames, must be perfect before uploading to testpypi or pypi.

- Run the `install_leo_locally` script. It should:
  - create a leo folder in the `Python3.x/Lib/site-packages` directory.
  - create three leo executables in the `Python3.x/scripts` directory.
  - When in doubt, run `pip cache purge`.
- Run the `run_installed_leo` script to test the distribution.
- Run the `uninstall_leo` script to uninstall Leo. It should report:
  - Two deleted folders from `Python3.x/Lib/site-packages`.
  - Three deleted scripts `Python3.x/scripts`.
- Optional(test that `pip install leo` installs all dependencies.
  - Run the `pip_uninstall_all` script to uninstall all packages.
  - Re-run the `install_leo_locally` script.
  - Re-run the `run_installed_leo` script.
  - Re-run the `uninstall_leo` script.

When all is well, go to step 3:

Step 3: Upload to testpypi and test:

- Run the `upload_leo_to_testpypi` script.
  Fix the name of the `.whl` file (see below) if the upload fails.
- Run the `install_leo_from_testpypi` script.
- Open testpypi: https://test.pypi.org/project/leo/
- Test and uninstall as in step 2 above.

Step 4: Upload to pypi and test:

Make *sure* all is well before uploading to pypi.

- Run the `upload_leo_to_pypi` script.
  Fix the name of the `.whl` file (see below) if the upload fails.
- Run the `install_leo_from_pypi` script.
- Open pypi: https://pypi.org/project/leo/
- Test and uninstall as in step 2 above.

*How to handle errors in steps 3 and 4*

Any glitch will require new filename *only* for the `.whl` file:
- Use *build number* (-1, -2) for the new filename:
  for example, leo-6.8.10-py3-none-any.whl.
- Do *not*use `.post1`: it won't work!
- Do *not* change the filename of `.tar.gz` file.
- Do *not* change `PKG-INFO.TXT` or Leo's version number!
</t>
<t tx="ekr.20250730064836.1" __bookmarks="7d7100580700000069735f6475706571014930300a732e">leoVersion.py:
- Update version constant.
- Update static date.
- Update date of the release, in &lt;&lt; version dates &gt;&gt; section.

Update versions in script files:
- PKG-INFO.TXT
- pyproject.toml
- scripts/inspect_wheel.py
- scripts/install_leo_from_pypi.py
- scripts/install_leo_from_testpypi.py
- scripts/install_leo_locally

</t>
<t tx="maphew.20180128212042.1">@language md
@wrap

Written by Matt Wilkie. Slightly revised by EKR.

PyPi is the Python Package Index Page: https://pypi.python.org/pypi

See https://github.com/leo-editor/leo-editor/issues/562

Once published to pypi Leo can be installed with:

    pip install leo

Developers should install from git as some files are left out when using pip (see Caveats):

    git clone --depth=500 https://github.com/leo-editor/leo-editor.git
    pip install -e .\leo-editor

nb: Optional `--depth=500` fetches the last 3-4 months of activity and is
    orders of magnitude faster than a full clone. If needed later use `git pull
    --unshallow` to grab everything that was missed.
</t>
<t tx="maphew.20180128212042.2">Install using pip if needed:

 - Wheel: for building cross platform binaries (might be installed already)
 - Setuptools: because ...setup!
 - Twine: for secure upload to pypi.org
 - Setupext-janitor: extend clean command (e.g. `python setup.py clean --all`)

    pip install setuptools twine wheel setupext-janitor
</t>
<t tx="maphew.20180128212042.3">A PyPi account is needed to update Leo's pypi reference. Contact one of the
package index owners to be added as a maintainer if needed. See end of
https://pypi.python.org/pypi/leo

Verify access Leo package edit page at:
https://pypi.python.org/pypi?%3Aaction=pkg_edit&amp;name=leo
</t>
<t tx="maphew.20180128212042.4">## Overview

_All of this is now handled in Travis Continual Integration build system. This recipe kept here for troubleshooting if something goes wrong in Travis._


* Remove stale distribution files &amp; folders.  
* Optionally set local checkout to specific version tag.  
* Build redistributable source and binary wheel package.  
* Upload to PyPi (assumes account registration already completed).  
* Test download and install from PyPi. Best to uninstall old Leo first or run in clean virtual env.

## Example

Windows syntax. 'Activate/deactivate' assume using virtual environments; skip those lines if not:

    activate leo-build
    
    rmdir /s/q dist build leo.egg-info
    git checkout tags/5.7
    python setup.py sdist bdist_wheel
    
    :: Optional, test install locally
    pip install dist\*.whl
    leo-console --version
    pip uninstall leo
    
    twine upload dist\*
    
    :: Optional, inspect public page for problems
    start https://pypi.python.org/pypi/leo
    
    deactivate
    
    :: For fuller test `conda create --name py3-clean` first instead of re-using
    activate py3-clean
    
    pip install leo
    leo-console --version

Twine upload will use username and password stored in `.pypirc`, or will prompt
if that doesn't exist.
</t>
<t tx="maphew.20180128212042.5">`pip install leo` only installs the contents of `leo` folder.
So links to files in the project root or other folders will be broken. (Background https://github.com/leo-editor/leo-editor/issues/573)

    ./leo-editor/*         --&gt; left out
    ./leo-editor/docs/*    --&gt; left out
    ./leo-editor/leo/*/*/* --&gt; PYTHONHOME/Lib/site-packages/leo

Docs: of little concern. These can regenerated from sources in ./leo (leoDocs.leo), and are on the website: http://leo-editor.github.io/leo-editor

Root: these files should only be involved in building installers and similar activities (e.g. leoDist.leo). Work from a git checkout or source tarball instead: https://github.com/leo-editor/leo-editor</t>
<t tx="maphew.20180128213245.1">TestPyPI: https://packaging.python.org/guides/using-testpypi/
is a separate instance of the Python Package Index (PyPI) that allows
trying out the distribution tools and process without worrying about affecting
the real index.

I (Matt) don't recommend using Test PyPi for Leo unless problems with the
package on the PyPi side are anticipated. It's too much of a pain to switch back
and forth between test and production when testing installs. In practice most
problems will be found and encountered when testing an install straight from the
whl file on disk:

    pip install dist\Leo-*.whl

That said, here's my recipe for packaging a new release for Test PyPi:
(Windows syntax)

    ::Verify integrity and Build (see leo\dist\build-*.bat)
    python setup.py check
    python setup.py bdist_wheel

    ::Test default install locally
    pip install dist\leo-5.7.dev344-py2.py3-none-any.whl
    leo-c --version
    pip uninstall leo

    ::Upload
    twine upload --repository-url https://test.pypi.org/legacy/ dist/leo-5.7.dev344-py2.py3-none-any

    ::Install from remote
    pip install --pre --index-url https://test.pypi.org/simple/ leo
    leo-c --version

Remove broken releases (still can't re-use identical version numbers and file names though):
https://testpypi.python.org/pypi?%3Aaction=pkg_edit&amp;name=leo
</t>
<t tx="maphew.20200424174643.1">@language md

# Build new Leo Anaconda Release
_a work in progress (matt)_

_I discovered Conda-Forge recipes already integrated with Continual Integration, and, once accepted, publishing to the conda forge package system. Here's what I know so far._

Local fork:
https://github.com/leo-editor/conda-forge-recipes/tree/leo

PR to merge with upstream:
https://github.com/conda-forge/staged-recipes/pull/11380


Note: the `meta.yaml` file in this folder is for reference not the real one used by the Conda Forge system. The local _staged recipes_ fork is the authoritative version:

https://github.com/leo-editor/conda-forge-recipes/tree/leo/recipes/leo/meta.yaml

## Release Procedure

1. Get tag name of release
2. Get sha256 hash for the release archive
3. Update `leo/meta.yaml` accordingly
4. Push to local fork
5. Check CI results in about 10 minutes

Follow up as needed.




### References

 - Conda Forge docs - [contributing packages][0]
 
 
 [0]: https://conda-forge.org/docs/maintainer/adding_pkgs.html
 </t>
<t tx="maphew.20200426185115.1"># Preliminary build recipe

    pushd code\leo-editor
    python setup.py sdist

Make note of archive name in dist/ and update meta.yaml accordingly:

    url: "../../../../dist/leo-6.2.dev106.tar.gz"

then:

    conda build leo\dist\conda\leo

There's **a lot** of disk use and screen output. Takes about 10 minutes. Basically it packages and installs Leo in a test env, and then packages that into final output, and then tests installing that again in turn.

If successful, test a local install in new env:

    conda create -n leo-conda
    conda activate leo-conda
    conda install c:\apps\Miniconda3\conda-bld\win-64\leo-6.2.dev106-py36_0.tar.bz2

If successful (according to docs, haven't made it this far yet):

    anaconda upload c:\apps\Miniconda3\conda-bld\win-64\leo-6.2.dev106-py36_0.tar.bz2

### Sources

- Official docs - https://docs.conda.io/projects/conda-build/en/latest/concepts/recipe.html

- @stas00; creating tarball using setup.py to stop copying entire work folder; https://github.com/conda/conda-build/issues/3214#issuecomment-431920525
</t>
<t tx="maphew.20200506223713.1">2020-05-06, matt

Having another go at building an all-in-one portable Leo executable with
PyInstaller


Guide: https://blog.aaronhktan.com/posts/2018/05/14/pyqt5-pyinstaller-executable

fix ModuleNotFoundError: No module named 'pkg_resources.py2_warn'
https://github.com/pypa/setuptools/issues/1963#issuecomment-574265532

-----

&gt; pip install pyinstaller
&gt; pyinstaller launchLeo.py
    # one time only, to make template .spec file

&gt; rename launchLeo.spec leo.spec

#edit .spec file and add:

a = Analysis(['launchLeo.py'],
             ...
             datas=[('leo', 'leo')],
             hiddenimports=['pkg_resources.py2_warn'],
             ...
             )

&gt; pyinstaller leo\dist\leo.spec

# open new CMD shell, verify no python or leo present, then:

&gt; dist\leo\leo.exe

# fix errors as can until everything works.

-----</t>
<t tx="maphew.20200605112459.1">Disabled for now.</t>
<t tx="maphew.20200605112532.1">@language yaml
# Create an "all in one" bundle of Leo and all dependencies for Windows that 
# doesn't need to be installed in order to run, just unzip and use.

name: Build standalone leo.exe

on:
  push:
    branches: [ master, devel, gh-act ]
    tags: 
      - 'v*' 
  pull_request:
    branches: [ master, devel, gh-act ]
    tags: 
      - 'v*' 

jobs:
  build:
    runs-on: windows-latest
    strategy:
      matrix:
        python-version: [3.6]

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python-version }}
    
    - name: Cache pip packages
      uses: actions/cache@v2
      with:
        path: ~\Appdata\Local\pip\Cache
        # note addition of py ver, https://github.com/actions/cache/issues/175#issuecomment-586641991
        #key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}
        key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/setup.py') }}
        restore-keys: |
          ${{ runner.os }}-${{ matrix.python-version }}-pip
    
    - name: Install Leo and dependencies
      run: |
        python -m pip install --upgrade pip
        #if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
        pip install wheel pyinstaller
        pip install --editable .
    - name: pyinstaller build
      run: |
        $ErrorView = 'NormalView'
        pwd
        ls
        pyinstaller leo/dist/leo.spec
    - name: create dist archive
      run: |
        $ErrorView = 'NormalView'
        python leo/dist/zip-leo-exe.py
    - uses: actions/upload-artifact@v2
      with:
        name: leo-windows-exe
        path: dist/*.zip
</t>
<t tx="matt.20190205105334.1">@language yaml
language: python
python:
  - "3.6"
git:
    ## Clone depth, must be big enough to include a tag
    depth: 500
install:
    - python -m pip install --upgrade pip
    - pip --version
    - pip install setupext-janitor asttokens
script:
    ## Test: Unit tests
    - python run_travis_unit_tests.py

    ## Test: Build python wheel, install, and run Leo in console mode
    - python setup.py --quiet bdist_wheel
    - pip install dist/*.whl
    - leo-console --version
    
deploy:
  - provider: pypi
    user: maphew
    password:
      secure: pZeDQzNu1XKDcGVEELttI/NqXMP5b5e99DgNzgTG+DVWU76sQ2wf4Jb1opIriHFQhN1etlndxVxp6YkugHDnu/B5rRklx+6WdAgHrIKcmbKzw86BsCzIwWqn1BqRlNT3mHo6uz1eQwQfJ/0/wptB5nougn8Z/E+hEIWbNgpu4CYr2TTa+9aWEpkg2h2ogOzZ1brp4hW2bJ0xW6XWBj+/bOsrgVKEmBvTZHkqFQSlODgHMJwsU3BWe/ntZ0J4QvLxseBSZM5tJTIG3w0pvGydGqxxAzbg1IY/4HZZFAttLGTr5ZJPBI2gPmz9FxmvJrWeV2iqkmMo8/OACqzSKYnMc2s8ACwUILNEZMSW+Z3IzFIUmomee3XKkkCCfbMi6eGHGYH2SFJLMnH11hGbr3yKY60FlWx8Hhds/aliGeEUdd6VqKfFeUgxcA4eDVSaAZCDFO9UWaFgrWdxEsi5aK+ElvrV/WYstouCOeMsfPIQREN8CPhQyvL4Q/gndLW904pmUkRQb9QMDzevL0gsBcP2I0mq742MmX3Kwk2gDyVxu1KafF1J6lFCBTWNyWqE18+CJxW/Qe7t1Qx7PPpDMf5kJwGtgOwg4hLELvSrA2hDL5h2kRtDoE1jkX0U5OLK2XWSHzFLLKt1VBNAal2JtJB1ii/7pC38jxFm/ZFRnOtJU0I=
    distributions: sdist bdist_wheel
    on:
      tags: true
      branch: master
</t>
<t tx="mhw.20191107064451.1">There is conceptual overlap between this node and the Desktop-integration
scripts held in Scripts.leo. My current thinking is the scripts should be moved
to or at least managed from Dist.

-matt  </t>
<t tx="mhw.20191107064521.1" _mod_time="4741d9587320af92dd2e">@language unknown_language
[Desktop Entry]
Encoding=UTF-8
Version=master
Type=Application
Terminal=true
Exec=/snap/bin/leo-editor.leo
Name=Leo Editor
Icon=/snap/meta/gui/icon.png
</t>
</tnodes>
</leo_file>
