Browse Source

Screenshot module cleanup, add download ADBSX logo

-Clean defSS
-Fix Windows SS issue, checking for root even thought it was Windows not Linux
-Auto get ADSBX logo for appending to screenshots
-Add webdrivermanager refrence
pull/2/head
Jxck-S 4 years ago
parent
commit
316888bafc
  1. 3
      AppendAirport.py
  2. 1
      Refrences.md
  3. 11
      defSS.py

3
AppendAirport.py

@ -43,7 +43,8 @@ def append_airport(filename, icao, airport, distance_mi):
draw.rectangle(((387, 738), (535, 760)), fill= navish)
#ADSBX Logo
draw.rectangle(((658, 760), (800, 780)), fill= white)
adsbx = Image.open('Stealth-48x48.png')
import requests
adsbx = Image.open(requests.get("https://www.adsbexchange.com/wp-content/uploads/cropped-Stealth-48px.png", stream=True).raw)
adsbx = adsbx.resize((25, 25), Image.ANTIALIAS)
image.paste(adsbx, (632, 757), adsbx)
#Create Text

1
Refrences.md

@ -45,6 +45,7 @@
- <https://tecadmin.net/setup-selenium-with-chromedriver-on-debian/>
- <https://blog.testproject.io/2018/02/20/chrome-headless-selenium-python-linux-servers/>
- <https://serverfault.com/questions/172076/how-to-find-the-browser-versions-from-command-line-in-linux-windows>
- <https://pypi.org/project/webdriver-manager/>
## Web Driver Manager

11
defSS.py

@ -1,11 +1,3 @@
#https://pypi.org/project/selenium/
#https://zwbetz.com/download-chromedriver-binary-and-add-to-your-path-for-automated-functional-testing/
#https://pythonspot.com/selenium-take-screenshot/
#https://sites.google.com/a/chromium.org/chromedriver/downloads
#https://tecadmin.net/setup-selenium-with-chromedriver-on-debian/
#https://blog.testproject.io/2018/02/20/chrome-headless-selenium-python-linux-servers/
#https://serverfault.com/questions/172076/how-to-find-the-browser-versions-from-command-line-in-linux-windows
#https://pypi.org/project/webdriver-manager/
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
import time
@ -18,7 +10,8 @@ def getSS(icao, overlays):
chrome_options.add_argument('ignore-certificate-errors')
chrome_options.add_argument("--enable-logging --v=1")
import os
if os.geteuid()==0:
import platform
if platform.system() == "Linux" and os.geteuid()==0:
chrome_options.add_argument('--no-sandbox') # required when running as root user. otherwise you would get no sandbox errors.
browser = webdriver.Chrome(ChromeDriverManager().install(), options=chrome_options)
url = "https://globe.adsbexchange.com/?largeMode=2&hideButtons&hideSidebar&mapDim=0&zoom=9&icao=" + icao + "&" + overlays

Loading…
Cancel
Save