initial commit
This commit is contained in:
		
						commit
						4f7b16755a
					
				
							
								
								
									
										178
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										178
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,178 @@
 | 
			
		||||
# ---> Python
 | 
			
		||||
# Byte-compiled / optimized / DLL files
 | 
			
		||||
__pycache__/
 | 
			
		||||
*.py[cod]
 | 
			
		||||
*$py.class
 | 
			
		||||
 | 
			
		||||
# C extensions
 | 
			
		||||
*.so
 | 
			
		||||
 | 
			
		||||
# Distribution / packaging
 | 
			
		||||
.Python
 | 
			
		||||
build/
 | 
			
		||||
develop-eggs/
 | 
			
		||||
dist/
 | 
			
		||||
downloads/
 | 
			
		||||
eggs/
 | 
			
		||||
.eggs/
 | 
			
		||||
lib/
 | 
			
		||||
lib64/
 | 
			
		||||
parts/
 | 
			
		||||
sdist/
 | 
			
		||||
var/
 | 
			
		||||
wheels/
 | 
			
		||||
share/python-wheels/
 | 
			
		||||
*.egg-info/
 | 
			
		||||
.installed.cfg
 | 
			
		||||
*.egg
 | 
			
		||||
MANIFEST
 | 
			
		||||
 | 
			
		||||
# PyInstaller
 | 
			
		||||
#  Usually these files are written by a python script from a template
 | 
			
		||||
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
 | 
			
		||||
*.manifest
 | 
			
		||||
*.spec
 | 
			
		||||
 | 
			
		||||
# Installer logs
 | 
			
		||||
pip-log.txt
 | 
			
		||||
pip-delete-this-directory.txt
 | 
			
		||||
 | 
			
		||||
# Unit test / coverage reports
 | 
			
		||||
htmlcov/
 | 
			
		||||
.tox/
 | 
			
		||||
.nox/
 | 
			
		||||
.coverage
 | 
			
		||||
.coverage.*
 | 
			
		||||
.cache
 | 
			
		||||
nosetests.xml
 | 
			
		||||
coverage.xml
 | 
			
		||||
*.cover
 | 
			
		||||
*.py,cover
 | 
			
		||||
.hypothesis/
 | 
			
		||||
.pytest_cache/
 | 
			
		||||
cover/
 | 
			
		||||
 | 
			
		||||
# Translations
 | 
			
		||||
*.mo
 | 
			
		||||
*.pot
 | 
			
		||||
 | 
			
		||||
# Django stuff:
 | 
			
		||||
*.log
 | 
			
		||||
local_settings.py
 | 
			
		||||
db.sqlite3
 | 
			
		||||
db.sqlite3-journal
 | 
			
		||||
 | 
			
		||||
# Flask stuff:
 | 
			
		||||
instance/
 | 
			
		||||
.webassets-cache
 | 
			
		||||
 | 
			
		||||
# Scrapy stuff:
 | 
			
		||||
.scrapy
 | 
			
		||||
 | 
			
		||||
# Sphinx documentation
 | 
			
		||||
docs/_build/
 | 
			
		||||
 | 
			
		||||
# PyBuilder
 | 
			
		||||
.pybuilder/
 | 
			
		||||
target/
 | 
			
		||||
 | 
			
		||||
# Jupyter Notebook
 | 
			
		||||
.ipynb_checkpoints
 | 
			
		||||
 | 
			
		||||
# IPython
 | 
			
		||||
profile_default/
 | 
			
		||||
ipython_config.py
 | 
			
		||||
 | 
			
		||||
# pyenv
 | 
			
		||||
#   For a library or package, you might want to ignore these files since the code is
 | 
			
		||||
#   intended to run in multiple environments; otherwise, check them in:
 | 
			
		||||
# .python-version
 | 
			
		||||
 | 
			
		||||
# pipenv
 | 
			
		||||
#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
 | 
			
		||||
#   However, in case of collaboration, if having platform-specific dependencies or dependencies
 | 
			
		||||
#   having no cross-platform support, pipenv may install dependencies that don't work, or not
 | 
			
		||||
#   install all needed dependencies.
 | 
			
		||||
#Pipfile.lock
 | 
			
		||||
 | 
			
		||||
# poetry
 | 
			
		||||
#   Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
 | 
			
		||||
#   This is especially recommended for binary packages to ensure reproducibility, and is more
 | 
			
		||||
#   commonly ignored for libraries.
 | 
			
		||||
#   https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
 | 
			
		||||
#poetry.lock
 | 
			
		||||
 | 
			
		||||
# pdm
 | 
			
		||||
#   Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
 | 
			
		||||
#pdm.lock
 | 
			
		||||
#   pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
 | 
			
		||||
#   in version control.
 | 
			
		||||
#   https://pdm.fming.dev/#use-with-ide
 | 
			
		||||
.pdm.toml
 | 
			
		||||
 | 
			
		||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
 | 
			
		||||
__pypackages__/
 | 
			
		||||
 | 
			
		||||
# Celery stuff
 | 
			
		||||
celerybeat-schedule
 | 
			
		||||
celerybeat.pid
 | 
			
		||||
 | 
			
		||||
# SageMath parsed files
 | 
			
		||||
*.sage.py
 | 
			
		||||
 | 
			
		||||
# Environments
 | 
			
		||||
.env
 | 
			
		||||
.venv
 | 
			
		||||
env/
 | 
			
		||||
venv/
 | 
			
		||||
ENV/
 | 
			
		||||
env.bak/
 | 
			
		||||
venv.bak/
 | 
			
		||||
 | 
			
		||||
# Spyder project settings
 | 
			
		||||
.spyderproject
 | 
			
		||||
.spyproject
 | 
			
		||||
 | 
			
		||||
# Rope project settings
 | 
			
		||||
.ropeproject
 | 
			
		||||
 | 
			
		||||
# mkdocs documentation
 | 
			
		||||
/site
 | 
			
		||||
 | 
			
		||||
# mypy
 | 
			
		||||
.mypy_cache/
 | 
			
		||||
.dmypy.json
 | 
			
		||||
dmypy.json
 | 
			
		||||
 | 
			
		||||
# Pyre type checker
 | 
			
		||||
.pyre/
 | 
			
		||||
 | 
			
		||||
# pytype static type analyzer
 | 
			
		||||
.pytype/
 | 
			
		||||
 | 
			
		||||
# Cython debug symbols
 | 
			
		||||
cython_debug/
 | 
			
		||||
 | 
			
		||||
# PyCharm
 | 
			
		||||
#  JetBrains specific template is maintained in a separate JetBrains.gitignore that can
 | 
			
		||||
#  be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
 | 
			
		||||
#  and can be added to the global gitignore or merged into this file.  For a more nuclear
 | 
			
		||||
#  option (not recommended) you can uncomment the following to ignore the entire idea folder.
 | 
			
		||||
#.idea/
 | 
			
		||||
 | 
			
		||||
# Visual Studio Code
 | 
			
		||||
.vscode/*
 | 
			
		||||
!.vscode/settings.json
 | 
			
		||||
!.vscode/tasks.json
 | 
			
		||||
!.vscode/launch.json
 | 
			
		||||
!.vscode/extensions.json
 | 
			
		||||
!.vscode/*.code-snippets
 | 
			
		||||
 | 
			
		||||
# Local History for Visual Studio Code
 | 
			
		||||
.history/
 | 
			
		||||
 | 
			
		||||
# Built Visual Studio Code Extensions
 | 
			
		||||
*.vsix
 | 
			
		||||
 | 
			
		||||
# vim
 | 
			
		||||
*.swp
 | 
			
		||||
							
								
								
									
										13
									
								
								LICENSE
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								LICENSE
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,13 @@
 | 
			
		||||
License: BSD-4-Clause-Shortened
 | 
			
		||||
 | 
			
		||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that:
 | 
			
		||||
 | 
			
		||||
(1) source code distributions retain the above copyright notice and this paragraph in its entirety,
 | 
			
		||||
(2) distributions including binary code include the above copyright notice and this paragraph in its entirety in the documentation or other materials provided with the distribution, and
 | 
			
		||||
(3) all advertising materials mentioning features or use of this software display the following acknowledgement:
 | 
			
		||||
 | 
			
		||||
"This product includes software developed by the University of California, Lawrence Berkeley Laboratory and its contributors.''
 | 
			
		||||
 | 
			
		||||
Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
 | 
			
		||||
 | 
			
		||||
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 | 
			
		||||
							
								
								
									
										61
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,61 @@
 | 
			
		||||
# pismotek-remote
 | 
			
		||||
 | 
			
		||||
Remote desktop connection application that will run a copy of TightVNC server performing a reverse connection to PismoTek.
 | 
			
		||||
 | 
			
		||||
## Setting up the build environment
 | 
			
		||||
Making the assumption that python is installed in `C:\Program Files\Python38` and Develmpent is being done under `C:\Development`
 | 
			
		||||
 | 
			
		||||
Pull a copy of this project from git:
 | 
			
		||||
```
 | 
			
		||||
cd \development
 | 
			
		||||
git clone https://git.elder-geek.net/Pismotek/pisomtek-remote.git
 | 
			
		||||
git clone ssh://git@git.elder-geek.net:10330/Pismotek/pismotek-remote.git
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Then setup this foulder with a virtual environment:
 | 
			
		||||
```
 | 
			
		||||
cd pismotek-remote
 | 
			
		||||
& "C:\Program Files\Python38\python" -m venv venv
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Activate the virtual enviroment:
 | 
			
		||||
```
 | 
			
		||||
venv\Script\activate
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Update `pip `and install requirments:
 | 
			
		||||
```
 | 
			
		||||
python -m pip install --upgrade pip
 | 
			
		||||
pip install -r requisments.txt
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Testing code after making edits:
 | 
			
		||||
```
 | 
			
		||||
python pismotek-remote.py
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
To create an executable in `C:\Development\pismotek-remote\dist`:
 | 
			
		||||
```
 | 
			
		||||
pyinstaller pismotek-remote.spec
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## To Activate the virtual enviroment from a new DOS prompt
 | 
			
		||||
```
 | 
			
		||||
cd \development\hcatitles
 | 
			
		||||
venv\Scripts\activate
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
When done working in the virtual enviroment:
 | 
			
		||||
```
 | 
			
		||||
deactivate
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## First time run of pyinstaller to generate hcatitles.spec
 | 
			
		||||
Windows uses `^` to continues a command on the next line.
 | 
			
		||||
```
 | 
			
		||||
pyinstaller --onefile --windowed --icon remotedesktop.ico ^
 | 
			
		||||
            --add-data "remotedesktop.ico:."
 | 
			
		||||
            pismotek-remote.py
 | 
			
		||||
 ```
 | 
			
		||||
							
								
								
									
										53
									
								
								pismotek-remote.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								pismotek-remote.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,53 @@
 | 
			
		||||
#!/bin/env python
 | 
			
		||||
 | 
			
		||||
import PySimpleGUI as sg
 | 
			
		||||
 | 
			
		||||
"""
 | 
			
		||||
    Pismotek-Remote - Remote Desktop Application
 | 
			
		||||
 | 
			
		||||
    To "swap out" a portion of a window, use a Column element for that portion.  Add multiple Columns
 | 
			
		||||
    on the same row and make only 1 of them active at a time
 | 
			
		||||
"""
 | 
			
		||||
 | 
			
		||||
# ----------- Create the 3 layouts this Window will display -----------
 | 
			
		||||
layout1 = [
 | 
			
		||||
    [sg.Text('This is layout 1')],
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
layout2 = [
 | 
			
		||||
    [sg.Text('This is layout 2')],
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
layout3 = [
 | 
			
		||||
    [sg.Text('This is layout 3')],
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
# ----------- Create actual layout using Columns and a row of Buttons
 | 
			
		||||
layout = [
 | 
			
		||||
    [
 | 
			
		||||
        sg.Column(layout1, key='-COL1-'),
 | 
			
		||||
        sg.Column(layout2, visible=False, key='-COL2-'),
 | 
			
		||||
        sg.Column(layout3, visible=False, key='-COL3-')
 | 
			
		||||
    ],
 | 
			
		||||
    [
 | 
			
		||||
        sg.Button('1'),
 | 
			
		||||
        sg.Button('2'),
 | 
			
		||||
        sg.Button('3'),
 | 
			
		||||
        sg.Button('Exit')
 | 
			
		||||
    ]
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
window = sg.Window('Swapping the contents of a window', layout)
 | 
			
		||||
 | 
			
		||||
layout = 1  # The currently visible layout
 | 
			
		||||
while True:
 | 
			
		||||
    event, values = window.read()
 | 
			
		||||
    print(event, values)
 | 
			
		||||
    if event in (sg.WIN_CLOSED, 'Exit'):
 | 
			
		||||
        break
 | 
			
		||||
    elif event in '123':
 | 
			
		||||
        window[f'-COL{layout}-'].update(visible=False)
 | 
			
		||||
        layout = int(event)
 | 
			
		||||
        window[f'-COL{layout}-'].update(visible=True)
 | 
			
		||||
window.close()
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								remotedesktop.ico
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								remotedesktop.ico
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 66 KiB  | 
							
								
								
									
										3
									
								
								requirements.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								requirements.txt
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
pyinstaller
 | 
			
		||||
pyinstaller-hooks-contrib
 | 
			
		||||
PySimpleGUI==4.60.1
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user