Skip to content

Commit

Permalink
Migrate code style to Black
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-Hall committed Jul 31, 2023
1 parent 6cb4380 commit 41720c5
Show file tree
Hide file tree
Showing 1,109 changed files with 91,881 additions and 67,814 deletions.
1 change: 1 addition & 0 deletions Gramps.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@
From this position, import gramps works great
"""
import gramps.grampsapp as app

app.main()
26 changes: 15 additions & 11 deletions aio/grampsaioc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,40 @@
import sys
import site

if getattr(sys, 'frozen', False):
if getattr(sys, "frozen", False):
aio = os.path.dirname(sys.executable)
sys.path.insert(1, aio)
sys.path.insert(1, os.path.join(aio,'lib'))
sys.path.insert(1, os.path.join(aio, "lib"))
sys.path.insert(1, site.getusersitepackages())
environ['PANGOCAIRO_BACKEND'] = 'fontconfig'
environ['SSL_CERT_FILE'] = join(aio, 'ssl/certs/ca-bundle.trust.crt')
environ['GI_TYPELIB_PATH'] = join(aio, 'lib/girepository-1.0')
environ['G_ENABLE_DIAGNOSTIC'] = '0'
environ['G_PARAM_DEPRECATED'] = '0'
environ['GRAMPS_RESOURCES'] = join(aio, 'share')
environ['PATH'] = aio + ';' + aio +'\lib;' + environ['PATH']
environ["PANGOCAIRO_BACKEND"] = "fontconfig"
environ["SSL_CERT_FILE"] = join(aio, "ssl/certs/ca-bundle.trust.crt")
environ["GI_TYPELIB_PATH"] = join(aio, "lib/girepository-1.0")
environ["G_ENABLE_DIAGNOSTIC"] = "0"
environ["G_PARAM_DEPRECATED"] = "0"
environ["GRAMPS_RESOURCES"] = join(aio, "share")
environ["PATH"] = aio + ";" + aio + "\lib;" + environ["PATH"]


def close():
sys.exit()


import atexit
import ctypes

HANDLE = ctypes.windll.kernel32.CreateMutexW(None, 1, "org.gramps-project.gramps")
ERROR = ctypes.GetLastError()
if ERROR == 183: #ERROR_ALREADY_EXISTS:
print('Gramps is already running!', file=sys.stderr)
if ERROR == 183: # ERROR_ALREADY_EXISTS:
print("Gramps is already running!", file=sys.stderr)
close()

atexit.register(ctypes.windll.kernel32.CloseHandle, HANDLE)
atexit.register(ctypes.windll.kernel32.ReleaseMutex, HANDLE)

import warnings

warnings.simplefilter("ignore")

import gramps.grampsapp as app

app.run()
21 changes: 11 additions & 10 deletions aio/grampsaiocd.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@
import sys
import site

if getattr(sys, 'frozen', False):
if getattr(sys, "frozen", False):
aio = os.path.dirname(sys.executable)
sys.path.insert(1, aio)
sys.path.insert(1, os.path.join(aio,'lib'))
sys.path.insert(1, os.path.join(aio, "lib"))
sys.path.insert(1, site.getusersitepackages())
environ['LANG'] = 'en'
environ['PANGOCAIRO_BACKEND'] = 'fontconfig'
environ['SSL_CERT_FILE'] = join(aio, 'ssl/certs/ca-bundle.trust.crt')
environ['GI_TYPELIB_PATH'] = join(aio, 'lib/girepository-1.0')
environ['G_ENABLE_DIAGNOSTIC'] = '0'
environ['G_PARAM_DEPRECATED'] = '0'
environ['GRAMPS_RESOURCES'] = join(aio, 'share')
environ['PATH'] = aio + ';' + aio +'\lib;' + environ['PATH']
environ["LANG"] = "en"
environ["PANGOCAIRO_BACKEND"] = "fontconfig"
environ["SSL_CERT_FILE"] = join(aio, "ssl/certs/ca-bundle.trust.crt")
environ["GI_TYPELIB_PATH"] = join(aio, "lib/girepository-1.0")
environ["G_ENABLE_DIAGNOSTIC"] = "0"
environ["G_PARAM_DEPRECATED"] = "0"
environ["GRAMPS_RESOURCES"] = join(aio, "share")
environ["PATH"] = aio + ";" + aio + "\lib;" + environ["PATH"]

import gramps.grampsapp as app

app.run()
29 changes: 16 additions & 13 deletions aio/grampsaiow.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
#!/usr/bin/env python3
'''
"""
grampsw.exe
'''
"""
import os
from os import environ
from os.path import join
import sys
import site

if getattr(sys, 'frozen', False):
if getattr(sys, "frozen", False):
aio = os.path.dirname(sys.executable)
sys.path.insert(1, aio)
sys.path.insert(1, os.path.join(aio,'lib'))
sys.path.insert(1, os.path.join(aio, "lib"))
sys.path.insert(1, site.getusersitepackages())
environ['SSL_CERT_FILE'] = join(aio, 'ssl/certs/ca-bundle.trust.crt')
environ['GI_TYPELIB_PATH'] = join(aio, 'lib/girepository-1.0')
environ['G_ENABLE_DIAGNOSTIC'] = '0'
environ['G_PARAM_DEPRECATED'] = '0'
environ['GRAMPS_RESOURCES'] = join(aio, 'share')
environ['PATH'] = aio + ';' + aio +'\lib;' + environ['PATH']
environ["SSL_CERT_FILE"] = join(aio, "ssl/certs/ca-bundle.trust.crt")
environ["GI_TYPELIB_PATH"] = join(aio, "lib/girepository-1.0")
environ["G_ENABLE_DIAGNOSTIC"] = "0"
environ["G_PARAM_DEPRECATED"] = "0"
environ["GRAMPS_RESOURCES"] = join(aio, "share")
environ["PATH"] = aio + ";" + aio + "\lib;" + environ["PATH"]

import atexit
import ctypes


def close():
''' Show warning dialog if Gramps is already running'''
sys.exit('Gramps is already running!')
"""Show warning dialog if Gramps is already running"""
sys.exit("Gramps is already running!")


HANDLE = ctypes.windll.kernel32.CreateMutexW(None, 1, "org.gramps-project.gramps")
ERROR = ctypes.GetLastError()
if ERROR == 183: #ERROR_ALREADY_EXISTS:
if ERROR == 183: # ERROR_ALREADY_EXISTS:
close()

atexit.register(ctypes.windll.kernel32.CloseHandle, HANDLE)
atexit.register(ctypes.windll.kernel32.ReleaseMutex, HANDLE)

import gramps.grampsapp as app

app.main()
Loading

0 comments on commit 41720c5

Please sign in to comment.