Compare commits
No commits in common. "main" and "v0.8" have entirely different histories.
|
@ -1,4 +1,4 @@
|
||||||
# Navpoint Desktop v0.11dev
|
# Navpoint Desktop
|
||||||
|
|
||||||
[Navpoint](https://git.kj7rrv.com/kj7rrv/navpoint) makes the user's current
|
[Navpoint](https://git.kj7rrv.com/kj7rrv/navpoint) makes the user's current
|
||||||
location available in KML format over a local HTTP server (listening on
|
location available in KML format over a local HTTP server (listening on
|
||||||
|
@ -20,7 +20,7 @@ recommended where possible, is from a USB GPS receiver that supports the [NMEA
|
||||||
0183](https://en.wikipedia.org/wiki/NMEA_0183) protocol. (A handheld GPS
|
0183](https://en.wikipedia.org/wiki/NMEA_0183) protocol. (A handheld GPS
|
||||||
receiver connected to a computer may or may not work; it does not work with my
|
receiver connected to a computer may or may not work; it does not work with my
|
||||||
Garmin GPSMAP 64st. Any common USB GPS dongle, such as [this one available from
|
Garmin GPSMAP 64st. Any common USB GPS dongle, such as [this one available from
|
||||||
Amazon](https://www.amazon.com/VK-162-G-Mouse-External-Navigation-Raspberry/dp/B01EROIUEW/),
|
Amazon](https://www.amazon.com/VK-162-G-Mouse-External-Navigation-Raspberry/dp/B01EROIUEW/)
|
||||||
should work, although, of course, I cannot guarantee that any particular device
|
should work, although, of course, I cannot guarantee that any particular device
|
||||||
will be compatible with Navpoint. On Windows, USB mode should work
|
will be compatible with Navpoint. On Windows, USB mode should work
|
||||||
out-of-the-box with a compatible GPS receiver; on Linux, your user account
|
out-of-the-box with a compatible GPS receiver; on Linux, your user account
|
||||||
|
|
|
@ -1,27 +1,18 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
arch=$(uname -m)
|
arch=$(uname -m)
|
||||||
version=$(head -n 1 README.md | awk '{print $4}')
|
distName=navpoint-linux-$arch
|
||||||
distName=navpoint-$version-linux-$arch
|
|
||||||
|
|
||||||
rm -rf dist/$distName-*
|
rm -rf dist/$distName-bundle
|
||||||
mkdir -p dist/$distName-bundle
|
mkdir -p dist/$distName-bundle
|
||||||
|
|
||||||
pyinstaller --windowed --onefile \
|
pyinstaller -w -F --hidden-import tornado.web --add-data README.md:files --add-data GPL-3.0.txt:files --add-data CC-BY-SA-4.0.txt:files main.py
|
||||||
--hidden-import tornado.web \
|
|
||||||
--add-data README.md:files \
|
|
||||||
--add-data GPL-3.0.txt:files \
|
|
||||||
--add-data CC-BY-SA-4.0.txt:files \
|
|
||||||
main.py
|
|
||||||
|
|
||||||
cp dist/main dist/$distName-standalone
|
cp dist/main dist/$distName-standalone
|
||||||
mv dist/main dist/$distName-bundle/navpoint
|
mv dist/main dist/$distName-bundle/navpoint
|
||||||
cp icon.png dist/$distName-bundle/navpoint.png
|
cp icon.png dist/$distName-bundle/navpoint.png
|
||||||
|
|
||||||
cp GPL-3.0.txt CC-BY-SA-4.0.txt dist/$distName-bundle/
|
cp GPL-3.0.txt CC-BY-SA-4.0.txt dist/$distName-bundle/
|
||||||
pandoc -s --metadata "title=Navpoint Desktop" README.md |
|
pandoc -s --metadata "title=Navpoint Desktop" README.md | grep -v 'h1 id="navpoint-desktop"' > dist/$distName-bundle/README.html
|
||||||
grep -v 'h1 id="navpoint-desktop"' \
|
|
||||||
> dist/$distName-bundle/README.html
|
|
||||||
|
|
||||||
cat > dist/$distName-bundle/navpoint.desktop << HERE
|
cat > dist/$distName-bundle/navpoint.desktop << HERE
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
|
|
4
build-windows.bat
Executable file
4
build-windows.bat
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
pyinstaller -i=icon.ico --windowed --onefile --hidden-import tornado.web --add-data icon.ico:files --add-data README.md:files --add-data GPL-3.0.txt:files --add-data CC-BY-SA-4.0.txt:files --name=navpoint.exe main.py
|
||||||
|
"C:\Program Files (x86)\NSIS\makensis.exe" .\windows_installer.nsi
|
||||||
|
move "dist\navpoint.exe" "dist\navpoint-windows-%PROCESSOR_ARCHITECTURE%-portable.exe"
|
||||||
|
move "dist\NavpointInstaller.exe" "dist\navpoint-windows-%PROCESSOR_ARCHITECTURE%-installer.exe"
|
|
@ -1,12 +0,0 @@
|
||||||
$version = (Get-Content -Path README.md -TotalCount 1).Split()[3]
|
|
||||||
$distName = "navpoint-$version-windows-$env:PROCESSOR_ARCHITECTURE"
|
|
||||||
|
|
||||||
Remove-Item -Path "dist\$distName-*"
|
|
||||||
|
|
||||||
pyinstaller --icon "icon.ico" --windowed --onefile --hidden-import "tornado.web" --add-data "icon.ico:files" --add-data "README.md:files" --add-data "GPL-3.0.txt:files" --add-data "CC-BY-SA-4.0.txt:files" --name "navpoint.exe" "main.py"
|
|
||||||
|
|
||||||
(Get-Content ".\windows_installer.nsi" -Raw).Replace("<<version>>", "$version").Replace("<<distName>>", "$distName") | Out-File ".\temp_installer.nsi"
|
|
||||||
& "C:\Program Files (x86)\NSIS\makensis.exe" ".\temp_installer.nsi"
|
|
||||||
Remove-Item -Path ".\temp_installer.nsi"
|
|
||||||
|
|
||||||
Move-Item -Path "dist\navpoint.exe" -Destination "dist\$distName-portable.exe"
|
|
|
@ -1,19 +1,17 @@
|
||||||
import webbrowser
|
import webbrowser
|
||||||
import threading
|
import tempfile
|
||||||
import asyncio
|
import time
|
||||||
|
import os
|
||||||
import markdown
|
import markdown
|
||||||
import tornado.web
|
|
||||||
import navpoint.fix_path
|
import navpoint.fix_path
|
||||||
|
|
||||||
class AboutHandler(tornado.web.RequestHandler):
|
|
||||||
def get(self):
|
def about():
|
||||||
with open(navpoint.fix_path.fix_path("README.md")) as f:
|
with open(navpoint.fix_path.fix_path("README.md")) as f:
|
||||||
readme = markdown.markdown(
|
readme = markdown.markdown(
|
||||||
f.read()
|
f.read()
|
||||||
.replace("https://www.gnu.org/licenses/gpl-3.0.en.html", "#gpl")
|
.replace("https://www.gnu.org/licenses/gpl-3.0.en.html", "#gpl")
|
||||||
.replace(
|
.replace("https://creativecommons.org/licenses/by-sa/4.0/", "#cc")
|
||||||
"https://creativecommons.org/licenses/by-sa/4.0/", "#cc"
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
with open(navpoint.fix_path.fix_path("GPL-3.0.txt")) as f:
|
with open(navpoint.fix_path.fix_path("GPL-3.0.txt")) as f:
|
||||||
|
@ -22,7 +20,11 @@ class AboutHandler(tornado.web.RequestHandler):
|
||||||
with open(navpoint.fix_path.fix_path("CC-BY-SA-4.0.txt")) as f:
|
with open(navpoint.fix_path.fix_path("CC-BY-SA-4.0.txt")) as f:
|
||||||
cc = f.read()
|
cc = f.read()
|
||||||
|
|
||||||
self.write(
|
fd, name = tempfile.mkstemp(suffix=".html")
|
||||||
|
os.close(fd)
|
||||||
|
|
||||||
|
with open(name, "w") as f:
|
||||||
|
f.write(
|
||||||
f"""\
|
f"""\
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
@ -44,19 +46,6 @@ class AboutHandler(tornado.web.RequestHandler):
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
webbrowser.open(name)
|
||||||
async def _run():
|
time.sleep(0.5) # Give the browser time to open the file
|
||||||
app = tornado.web.Application(
|
os.remove(name)
|
||||||
[
|
|
||||||
("/", AboutHandler),
|
|
||||||
]
|
|
||||||
)
|
|
||||||
app.listen(9999, address="127.0.0.1")
|
|
||||||
await asyncio.Event().wait()
|
|
||||||
|
|
||||||
def run_server():
|
|
||||||
threading.Thread(target=asyncio.run, args=(_run(),), daemon=True).start()
|
|
||||||
|
|
||||||
|
|
||||||
def about():
|
|
||||||
webbrowser.open("http://127.0.0.1:9999/")
|
|
||||||
|
|
|
@ -6,9 +6,6 @@ import navpoint.phone_server
|
||||||
import navpoint.usb
|
import navpoint.usb
|
||||||
import navpoint.about
|
import navpoint.about
|
||||||
|
|
||||||
def _version():
|
|
||||||
with open(navpoint.fix_path.fix_path("README.md")) as f:
|
|
||||||
return f.readline().split()[3]
|
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
def _usb_clicked():
|
def _usb_clicked():
|
||||||
|
@ -37,10 +34,10 @@ def run():
|
||||||
window, text="Phone running Navpoint Mobile", command=_mobile_clicked
|
window, text="Phone running Navpoint Mobile", command=_mobile_clicked
|
||||||
)
|
)
|
||||||
mobile_button.pack()
|
mobile_button.pack()
|
||||||
ttk.Separator(window, orient="horizontal").pack(fill="x", pady=3)
|
ttk.Separator(window, orient="horizontal").pack()
|
||||||
ttk.Label(window, text="Navpoint is free and open-source.").pack()
|
ttk.Label(window, text="Navpoint is free and open-source.").pack()
|
||||||
about_button = ttk.Button(
|
about_button = ttk.Button(
|
||||||
window, text="About Navpoint " + _version(), command=navpoint.about.about
|
window, text="About Navpoint", command=navpoint.about.about
|
||||||
)
|
)
|
||||||
about_button.pack()
|
about_button.pack()
|
||||||
|
|
||||||
|
@ -49,7 +46,6 @@ def run():
|
||||||
except tk.TclError:
|
except tk.TclError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
navpoint.about.run_server()
|
|
||||||
window.mainloop()
|
window.mainloop()
|
||||||
|
|
||||||
if mode == "mobile":
|
if mode == "mobile":
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Name "Navpoint <<version>>"
|
OutFile "dist\NavpointInstaller.exe"
|
||||||
OutFile "dist\<<distName>>-installer.exe"
|
# define installation directory
|
||||||
InstallDir $PROFILE\Navpoint
|
InstallDir $PROFILE\Navpoint
|
||||||
|
|
||||||
RequestExecutionLevel user
|
RequestExecutionLevel user
|
||||||
|
@ -9,15 +9,25 @@ Section
|
||||||
SetOutPath $INSTDIR
|
SetOutPath $INSTDIR
|
||||||
|
|
||||||
File dist\navpoint.exe
|
File dist\navpoint.exe
|
||||||
CreateShortcut "$SMPROGRAMS\Navpoint.lnk" "$INSTDIR\navpoint.exe"
|
|
||||||
CreateShortcut "$DESKTOP\Navpoint.lnk" "$INSTDIR\navpoint.exe"
|
|
||||||
|
|
||||||
|
# create the uninstaller
|
||||||
WriteUninstaller "$INSTDIR\uninstall.exe"
|
WriteUninstaller "$INSTDIR\uninstall.exe"
|
||||||
|
|
||||||
|
# create a shortcut named "new shortcut" in the start menu programs directory
|
||||||
|
# point the new shortcut at the program uninstaller
|
||||||
CreateShortcut "$SMPROGRAMS\Uninstall Navpoint.lnk" "$INSTDIR\uninstall.exe"
|
CreateShortcut "$SMPROGRAMS\Uninstall Navpoint.lnk" "$INSTDIR\uninstall.exe"
|
||||||
|
CreateShortcut "$SMPROGRAMS\Navpoint.lnk" "$INSTDIR\navpoint.exe"
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
# uninstaller section start
|
||||||
Section "uninstall"
|
Section "uninstall"
|
||||||
|
|
||||||
|
# Remove the link from the start menu
|
||||||
Delete "$SMPROGRAMS\Uninstall Navpoint.lnk"
|
Delete "$SMPROGRAMS\Uninstall Navpoint.lnk"
|
||||||
|
|
||||||
|
# Delete the uninstaller
|
||||||
Delete $INSTDIR\uninstaller.exe
|
Delete $INSTDIR\uninstaller.exe
|
||||||
|
|
||||||
RMDir $INSTDIR
|
RMDir $INSTDIR
|
||||||
|
# uninstaller section end
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
Loading…
Reference in New Issue
Block a user