Skip to content

Commit 929ff46

Browse files
committed
Add sample scripts to installer and zip releases
1 parent 49ed4d7 commit 929ff46

File tree

7 files changed

+34
-6
lines changed

7 files changed

+34
-6
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef _PYTHONSCRIPTVERSION_H
22
#define _PYTHONSCRIPTVERSION_H
33

4-
#define PYSCR_VERSION_NUMERIC 1,0,0,0
5-
#define PYSCR_VERSION_STRING "1.0.0.0"
4+
#define PYSCR_VERSION_NUMERIC 1,0,0,1
5+
#define PYSCR_VERSION_STRING "1.0.0.1"
66

77
#endif

installer/PythonScript.wxs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<File Id="F_startup.py" KeyPath="yes" Name="startup.py" Source="$(var.baseDir)\scripts\startup.py" />
3737
</Component>
3838
<Directory Id="D_npp_unit_tests" Name="npp_unit_tests" />
39+
<Directory Id="D_SampleScripts" Name="Samples" />
3940
</Directory>
4041
</Directory>
4142
<Directory Id="D_doc" Name="doc">
@@ -70,6 +71,9 @@
7071
<Feature Id="FT_Help" Title="Help" AllowAdvertise="no" Description="CHM file with documentation for all the classes, methods and enums in PythonScript">
7172
<ComponentRef Id="C_PythonScript.chm" />
7273
</Feature>
74+
<Feature Id="FT_SampleScripts" Title="Sample Scripts" AllowAdvertise="no" Description="Sample scripts to show basic usage">
75+
<ComponentGroupRef Id="CG_SampleScripts" />
76+
</Feature>
7377
<Feature Id="FT_ExtraLibs" Title="Extra Libraries" Level="10" AllowAdvertise="no" Description="distutils, lib2to3 and bsddb support">
7478
<ComponentGroupRef Id="CG_PythonExtraLib" />
7579
</Feature>

installer/buildInstaller.bat

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,17 @@ if NOT [%ERRORLEVEL%]==[0] (
6666
goto error
6767
)
6868

69+
echo Generating WiX information for ..\PythonScript\scripts\Samples
70+
heat dir ..\scripts\Samples -ag -cg CG_SampleScripts -dr D_PythonScript -var var.scriptSource -t changeDirSampleScripts.xsl -o temp\sampleScripts.wxs
71+
if NOT [%ERRORLEVEL%]==[0] (
72+
goto error
73+
)
74+
75+
echo Compiling Sample Scripts WiX source
76+
candle temp\sampleScripts.wxs -o temp\sampleScripts.wixobj -dscriptSource=..\scripts\Samples
77+
if NOT [%ERRORLEVEL%]==[0] (
78+
goto error
79+
)
6980

7081

7182
echo Generating WiX information for ..\PythonScript\python_tests
@@ -90,7 +101,7 @@ if NOT [%ERRORLEVEL%]==[0] (
90101

91102

92103
echo Linking installer - generating MSI
93-
light temp\pythonscript.wixobj temp\fullLib.wixobj temp\extra.wixobj temp\unittests.wixobj temp\tcl.wixobj -o build\PythonScript_%PYTHONSCRIPTVERSION%.msi -ext WixUIExtension
104+
light temp\pythonscript.wixobj temp\fullLib.wixobj temp\extra.wixobj temp\unittests.wixobj temp\tcl.wixobj temp\sampleScripts.wixobj -o build\PythonScript_%PYTHONSCRIPTVERSION%.msi -ext WixUIExtension
94105
if NOT [%ERRORLEVEL%]==[0] (
95106
goto error
96107
)

installer/buildReleaseZips.bat

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ rd /s /q temp\release
5454

5555
echo Creating directories
5656
mkdir temp\release\Full\plugins\PythonScript\lib
57+
mkdir temp\release\Full\plugins\PythonScript\scripts
5758
mkdir temp\release\Full\plugins\doc\PythonScript
5859
mkdir temp\release\Min\plugins\PythonScript\lib
60+
mkdir temp\release\Min\plugins\PythonScript\scripts
5961
mkdir temp\release\Min\plugins\doc\PythonScript
6062
mkdir temp\release\Extra\plugins\PythonScript\lib
6163
mkdir temp\release\Tcl\plugins\PythonScript\lib\tcl
@@ -72,6 +74,10 @@ echo Copying Help
7274
copy ..\docs\build\htmlhelp\PythonScript.chm temp\release\full\plugins\doc\PythonScript
7375
copy ..\docs\build\htmlhelp\PythonScript.chm temp\release\min\plugins\doc\PythonScript
7476

77+
echo Copying Scripts
78+
xcopy /s /q ..\scripts\*.* temp\release\full\plugins\PythonScript\scripts
79+
copy ..\scripts\startup.py temp\release\min\plugins\PythonScript\scripts
80+
7581
echo Copying Lib directories
7682
xcopy /s /q ..\PythonLib\full\*.* temp\release\full\plugins\PythonScript\lib
7783
xcopy /s /q ..\PythonLib\min\*.* temp\release\min\plugins\PythonScript\lib
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:wix="http://schemas.microsoft.com/wix/2006/wi" version="1.0">
2+
3+
<xsl:output method="xml" indent="yes" />
4+
<xsl:param name="realDirectoryId" select="'D_SampleScripts'" />
5+
<xsl:include href="fixDirectoryAndFileRefs.xsl" />
6+
7+
</xsl:stylesheet>

scripts/Samples/Python Regex Replacements.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
# so ABDABD, DEFDEF or DGBDGB etc. the first 3 characters,
1111
# so ABD, DEF and DGB in these cases.
1212

13-
editor.pyreplace(r"([A-Z]{3})\1", r"\1")
13+
editor.rereplace(r"([A-Z]{3})\1", r"\1")
1414

1515
# Do a multi-line Python regular expression replace.
1616

1717
# This example replaces any <br/> that is followed by another on the next line (with optional spaces in between), with a single one
18-
editor.pymlreplace(r"<br/>\s*\r\n\s*<br/>", "<br/>\r\n")
18+
editor.rereplace(r"<br/>\s*\r\n\s*<br/>", "<br/>\r\n")
1919

2020

2121
# End the undo action, so Ctrl-Z will undo the above two actions

scripts/Samples/Remove and Modify selected lines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def testContents(contents, lineNumber, totalLines):
1111
editor.replaceLine(lineNumber, "something new")
1212

1313
elif contents.strip() == "little something":
14-
editor.replaceLine(lineNumber, "BIG\nSOMETHING"
14+
editor.replaceLine(lineNumber, "BIG\nSOMETHING")
1515
# Here we return 2, as we've inserted a newline,
1616
# and we don't want to test the "SOMETHING" line again
1717
return 2

0 commit comments

Comments
 (0)