Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
Added os and build version info to log file
Browse files Browse the repository at this point in the history
  • Loading branch information
MitjaNemec committed Mar 5, 2020
1 parent c2a0ca7 commit 94987de
Show file tree
Hide file tree
Showing 28 changed files with 184 additions and 19 deletions.
10 changes: 10 additions & 0 deletions archive_project/action_archive_project.py
Expand Up @@ -42,6 +42,12 @@
with open(version_filename) as f:
VERSION = f.readline().strip()

# > V5.1.5 and V 5.99 build information
if hasattr(pcbnew, 'GetBuildVersion'):
BUILD_VERSION = pcbnew.GetBuildVersion()
else:
BUILD_VERSION = "Unknown"


class ArchiveProjectDialog (archive_project_GUI.ArchiveProjectGUI):
# hack for new wxFormBuilder generating code incompatible with old wxPython
Expand Down Expand Up @@ -98,6 +104,10 @@ def Run(self):
format='%(asctime)s %(name)s %(lineno)d:%(message)s',
datefmt='%m-%d %H:%M:%S')
logger = logging.getLogger(__name__)

logger.info("Plugin executed on: " + repr(sys.platform))
logger.info("Plugin executed with python version: " + repr(sys.version))
logger.info("KiCad build version: " + BUILD_VERSION)
logger.info("Archive plugin version: " + VERSION + " started")

stdout_logger = logging.getLogger('STDOUT')
Expand Down
9 changes: 9 additions & 0 deletions archive_project/archive_project.py
Expand Up @@ -21,6 +21,12 @@
with open(version_filename) as f:
VERSION = f.readline().strip()

# > V5.1.5 and V 5.99 build information
if hasattr(pcbnew, 'GetBuildVersion'):
BUILD_VERSION = pcbnew.GetBuildVersion()
else:
BUILD_VERSION = "Unknown"


def balanced_braces(args):
if isinstance(args, str):
Expand Down Expand Up @@ -681,6 +687,9 @@ def main():
)

logger = logging.getLogger(__name__)
logger.info("Plugin executed on: " + repr(sys.platform))
logger.info("Plugin executed with python version: " + repr(sys.version))
logger.info("KiCad build version: " + BUILD_VERSION)
logger.info("Archive plugin version: " + VERSION + " started in standalone mode")

main()
2 changes: 1 addition & 1 deletion archive_project/version.txt
@@ -1 +1 @@
41
42
6 changes: 5 additions & 1 deletion delete_selected/action_delete_selected.py
Expand Up @@ -32,7 +32,11 @@
version_filename = os.path.join(os.path.dirname(os.path.realpath(__file__)), "version.txt")
with open(version_filename) as f:
VERSION = f.readline().strip()

# > V5.1.5 and V 5.99 build information
if hasattr(pcbnew, 'GetBuildVersion'):
BUILD_VERSION = pcbnew.GetBuildVersion()
else:
BUILD_VERSION = "Unknown"

class DeleteLayoutDialog(delete_selected_GUI.DeleteSelectedGUI):
# hack for new wxFormBuilder generating code incompatible with old wxPython
Expand Down
2 changes: 1 addition & 1 deletion delete_selected/version.txt
@@ -1 +1 @@
13
14
10 changes: 10 additions & 0 deletions length_stats/action_length_stats.py
Expand Up @@ -39,6 +39,13 @@
with open(version_filename) as f:
VERSION = f.readline().strip()

# > V5.1.5 and V 5.99 build information
if hasattr(pcbnew, 'GetBuildVersion'):
BUILD_VERSION = pcbnew.GetBuildVersion()
else:
BUILD_VERSION = "Unknown"


class LenghtStatsDialog(lenght_stats_GUI.LenghtStatsGUI):
# hack for new wxFormBuilder generating code incompatible with old wxPython
# noinspection PyMethodOverriding
Expand Down Expand Up @@ -261,6 +268,9 @@ def Run(self):
format='%(asctime)s %(name)s %(lineno)d:%(message)s',
datefmt='%m-%d %H:%M:%S')
logger = logging.getLogger(__name__)
logger.info("Plugin executed on: " + repr(sys.platform))
logger.info("Plugin executed with python version: " + repr(sys.version))
logger.info("KiCad build version: " + BUILD_VERSION)
logger.info("Length stats plugin version: " + VERSION + " started")

stdout_logger = logging.getLogger('STDOUT')
Expand Down
2 changes: 1 addition & 1 deletion length_stats/version.txt
@@ -1 +1 @@
28
29
10 changes: 10 additions & 0 deletions net2net_min_distance/action_net2net_min_distance.py
Expand Up @@ -36,6 +36,13 @@
with open(version_filename) as f:
VERSION = f.readline().strip()

# > V5.1.5 and V 5.99 build information
if hasattr(pcbnew, 'GetBuildVersion'):
BUILD_VERSION = pcbnew.GetBuildVersion()
else:
BUILD_VERSION = "Unknown"


class Net2NedDistance(pcbnew.ActionPlugin):
"""
A script to delete selection
Expand Down Expand Up @@ -74,6 +81,9 @@ def Run(self):
format='%(asctime)s %(name)s %(lineno)d:%(message)s',
datefmt='%m-%d %H:%M:%S')
logger = logging.getLogger(__name__)
logger.info("Plugin executed on: " + repr(sys.platform))
logger.info("Plugin executed with python version: " + repr(sys.version))
logger.info("KiCad build version: " + BUILD_VERSION)
logger.info("Net2net distance plugin version: " + VERSION + " started")

stdout_logger = logging.getLogger('STDOUT')
Expand Down
10 changes: 10 additions & 0 deletions net2net_min_distance/net2net_distance.py
Expand Up @@ -34,6 +34,13 @@
with open(version_filename) as f:
VERSION = f.readline().strip()

# > V5.1.5 and V 5.99 build information
if hasattr(pcbnew, 'GetBuildVersion'):
BUILD_VERSION = pcbnew.GetBuildVersion()
else:
BUILD_VERSION = "Unknown"


def segments_distance(x11, y11, x12, y12, x21, y21, x22, y22):
""" distance between two segments in the plane:
one segment is (x11, y11) to (x12, y12)
Expand Down Expand Up @@ -183,6 +190,9 @@ def main():
)

logger = logging.getLogger(__name__)
logger.info("Plugin executed on: " + repr(sys.platform))
logger.info("Plugin executed with python version: " + repr(sys.version))
logger.info("KiCad build version: " + BUILD_VERSION)
logger.info("Net2net plugin version: " + VERSION + " started in standalone mode")

main()
2 changes: 1 addition & 1 deletion net2net_min_distance/version.txt
@@ -1 +1 @@
14
15
11 changes: 10 additions & 1 deletion pad2pad_track_distance/action_pad2pad_track_distance.py
Expand Up @@ -40,7 +40,13 @@
with open(version_filename) as f:
VERSION = f.readline().strip()


# > V5.1.5 and V 5.99 build information
if hasattr(pcbnew, 'GetBuildVersion'):
BUILD_VERSION = pcbnew.GetBuildVersion()
else:
BUILD_VERSION = "Unknown"


class Pad2PadTrackDistanceDialog(pad2pad_track_distance_GUI.Pad2PadTrackDistanceGUI):
# hack for new wxFormBuilder generating code incompatible with old wxPython
# noinspection PyMethodOverriding
Expand Down Expand Up @@ -109,6 +115,9 @@ def Run(self):
format='%(asctime)s %(name)s %(lineno)d:%(message)s',
datefmt='%m-%d %H:%M:%S')
logger = logging.getLogger(__name__)
logger.info("Plugin executed on: " + repr(sys.platform))
logger.info("Plugin executed with python version: " + repr(sys.version))
logger.info("KiCad build version: " + BUILD_VERSION)
logger.info("Length stats plugin version: " + VERSION + " started")

stdout_logger = logging.getLogger('STDOUT')
Expand Down
9 changes: 9 additions & 0 deletions pad2pad_track_distance/pad2pad_track_distance.py
Expand Up @@ -35,6 +35,12 @@
with open(version_filename) as f:
VERSION = f.readline().strip()

# > V5.1.5 and V 5.99 build information
if hasattr(pcbnew, 'GetBuildVersion'):
BUILD_VERSION = pcbnew.GetBuildVersion()
else:
BUILD_VERSION = "Unknown"


class Distance:
def __init__(self, board, pad1, pad2):
Expand Down Expand Up @@ -265,6 +271,9 @@ def main():
)

logger = logging.getLogger(__name__)
logger.info("Plugin executed on: " + repr(sys.platform))
logger.info("Plugin executed with python version: " + repr(sys.version))
logger.info("KiCad build version: " + BUILD_VERSION)
logger.info("pad2pad distance plugin version: " + VERSION + " started in standalone mode")

main()
2 changes: 1 addition & 1 deletion pad2pad_track_distance/version.txt
@@ -1 +1 @@
23
24
21 changes: 15 additions & 6 deletions place_footprints/action_place_footprints.py
Expand Up @@ -40,6 +40,18 @@
from . import place_by_sheet_GUI


# get version information
version_filename = os.path.join(os.path.dirname(os.path.realpath(__file__)), "version.txt")
with open(version_filename) as f:
VERSION = f.readline().strip()

# > V5.1.5 and V 5.99 build information
if hasattr(pcbnew, 'GetBuildVersion'):
BUILD_VERSION = pcbnew.GetBuildVersion()
else:
BUILD_VERSION = "Unknown"


def natural_sort(l):
convert = lambda text: int(text) if text.isdigit() else text.lower()
alphanum_key = lambda key: [convert(c) for c in re.split('([0-9]+)', key)]
Expand All @@ -64,12 +76,6 @@ def clear_highlight_on_module(module):
item.ClearBrightened()


# get version information
version_filename = os.path.join(os.path.dirname(os.path.realpath(__file__)), "version.txt")
with open(version_filename) as f:
VERSION = f.readline().strip()


class PlaceBySheet(place_by_sheet_GUI.PlaceBySheetGUI):
# hack for new wxFormBuilder generating code incompatible with old wxPython
# noinspection PyMethodOverriding
Expand Down Expand Up @@ -405,6 +411,9 @@ def Run(self):
format='%(asctime)s %(name)s %(lineno)d:%(message)s',
datefmt='%m-%d %H:%M:%S')
logger = logging.getLogger(__name__)
logger.info("Plugin executed on: " + repr(sys.platform))
logger.info("Plugin executed with python version: " + repr(sys.version))
logger.info("KiCad build version: " + BUILD_VERSION)
logger.info("Place footprints plugin version: " + VERSION + " started")

stdout_logger = logging.getLogger('STDOUT')
Expand Down
9 changes: 9 additions & 0 deletions place_footprints/place_footprints.py
Expand Up @@ -40,6 +40,12 @@
with open(version_filename) as f:
VERSION = f.readline().strip()

# > V5.1.5 and V 5.99 build information
if hasattr(pcbnew, 'GetBuildVersion'):
BUILD_VERSION = pcbnew.GetBuildVersion()
else:
BUILD_VERSION = "Unknown"


def natural_sort(l):
convert = lambda text: int(text) if text.isdigit() else text.lower()
Expand Down Expand Up @@ -508,6 +514,9 @@ def main():
)

logger = logging.getLogger(__name__)
logger.info("Plugin executed on: " + repr(sys.platform))
logger.info("Plugin executed with python version: " + repr(sys.version))
logger.info("KiCad build version: " + BUILD_VERSION)
logger.info("Place footprints plugin version: " + VERSION + " started in standalone mode")

main()
2 changes: 1 addition & 1 deletion place_footprints/version.txt
@@ -1 +1 @@
38
39
10 changes: 10 additions & 0 deletions replicate_layout/action_replicate_layout.py
Expand Up @@ -39,6 +39,12 @@
with open(version_filename) as f:
VERSION = f.readline().strip()

# > V5.1.5 and V 5.99 build information
if hasattr(pcbnew, 'GetBuildVersion'):
BUILD_VERSION = pcbnew.GetBuildVersion()
else:
BUILD_VERSION = "Unknown"


def set_highlight_on_module(module):
pads_list = module.Pads()
Expand Down Expand Up @@ -295,6 +301,10 @@ def Run(self):
format='%(asctime)s %(name)s %(lineno)d:%(message)s',
datefmt='%m-%d %H:%M:%S')
logger = logging.getLogger(__name__)

logger.info("Plugin executed on: " + repr(sys.platform))
logger.info("Plugin executed with python version: " + repr(sys.version))
logger.info("KiCad build version: " + BUILD_VERSION)
logger.info("Replicate layout plugin version: " + VERSION + " started")

stdout_logger = logging.getLogger('STDOUT')
Expand Down
11 changes: 10 additions & 1 deletion replicate_layout/replicatelayout.py
Expand Up @@ -37,7 +37,7 @@
from . import compare_boards
from . import remove_duplicates

# V5.99 compatibility
# V5.99 compatibility - flip method
if pcbnew.MODULE.Flip.__doc__ == "Flip(MODULE self, wxPoint aCentre, bool aFlipLeftRight)":
# remap the current method to new name
pcbnew.MODULE.Flip_new = pcbnew.MODULE.Flip
Expand All @@ -58,6 +58,12 @@ def old_flip(self, aCentre):
with open(version_filename) as f:
VERSION = f.readline().strip()

# > V5.1.5 and V 5.99 build information
if hasattr(pcbnew, 'GetBuildVersion'):
BUILD_VERSION = pcbnew.GetBuildVersion()
else:
BUILD_VERSION = "Unknown"


def rotate_around_center(coordinates, angle):
""" rotate coordinates for a defined angle in degrees around coordinate center"""
Expand Down Expand Up @@ -1127,6 +1133,9 @@ def main():
)

logger = logging.getLogger(__name__)
logger.info("Plugin executed on: " + repr(sys.platform))
logger.info("Plugin executed with python version: " + repr(sys.version))
logger.info("KiCad build version: " + BUILD_VERSION)
logger.info("Replicate layout plugin version: " + VERSION + " started in standalone mode")

main()
2 changes: 1 addition & 1 deletion replicate_layout/version.txt
@@ -1 +1 @@
54
55
8 changes: 8 additions & 0 deletions save_restore_layout/action_save_restore_layout.py
Expand Up @@ -42,6 +42,12 @@
with open(version_filename) as f:
VERSION = f.readline().strip()

# > V5.1.5 and V 5.99 build information
if hasattr(pcbnew, 'GetBuildVersion'):
BUILD_VERSION = pcbnew.GetBuildVersion()
else:
BUILD_VERSION = "Unknown"


def set_highlight_on_module(module):
logging.info("highlighting module: " + repr(module.GetReference()))
Expand Down Expand Up @@ -151,7 +157,9 @@ def Run(self):
format='%(asctime)s %(name)s %(lineno)d:%(message)s',
datefmt='%m-%d %H:%M:%S')
logger = logging.getLogger(__name__)
logger.info("Plugin executed on: " + repr(sys.platform))
logger.info("Plugin executed with python version: " + repr(sys.version))
logger.info("KiCad build version: " + BUILD_VERSION)
logger.info("Save/Restore Layout plugin version: " + VERSION + " started")

stdout_logger = logging.getLogger('STDOUT')
Expand Down
13 changes: 13 additions & 0 deletions save_restore_layout/save_restore_layout.py
Expand Up @@ -37,6 +37,17 @@

logger = logging.getLogger(__name__)

# get version information
version_filename = os.path.join(os.path.dirname(os.path.realpath(__file__)), "version.txt")
with open(version_filename) as f:
VERSION = f.readline().strip()

# > V5.1.5 and V 5.99 build information
if hasattr(pcbnew, 'GetBuildVersion'):
BUILD_VERSION = pcbnew.GetBuildVersion()
else:
BUILD_VERSION = "Unknown"


def rotate_around_center(coordinates, angle):
""" rotate coordinates for a defined angle in degrees around coordinate center"""
Expand Down Expand Up @@ -1003,7 +1014,9 @@ def main():
)

logger = logging.getLogger(__name__)
logger.info("Plugin executed on: " + repr(sys.platform))
logger.info("Plugin executed with python version: " + repr(sys.version))
logger.info("KiCad build version: " + BUILD_VERSION)
logger.info("Save/Restore Layout plugin started in standalone mode")

main()
2 changes: 1 addition & 1 deletion save_restore_layout/version.txt
@@ -1 +1 @@
37
38
9 changes: 9 additions & 0 deletions swap_pins/action_swap_pins.py
Expand Up @@ -35,6 +35,12 @@
with open(version_filename) as f:
VERSION = f.readline().strip()

# > V5.1.5 and V 5.99 build information
if hasattr(pcbnew, 'GetBuildVersion'):
BUILD_VERSION = pcbnew.GetBuildVersion()
else:
BUILD_VERSION = "Unknown"


class SwapPins(pcbnew.ActionPlugin):
"""
Expand Down Expand Up @@ -78,6 +84,9 @@ def Run(self):
format='%(asctime)s %(name)s %(lineno)d:%(message)s',
datefmt='%m-%d %H:%M:%S')
logger = logging.getLogger(__name__)
logger.info("Plugin executed on: " + repr(sys.platform))
logger.info("Plugin executed with python version: " + repr(sys.version))
logger.info("KiCad build version: " + BUILD_VERSION)
logger.info("Swap pins plugin version: " + VERSION + " started")

stdout_logger = logging.getLogger('STDOUT')
Expand Down

0 comments on commit 94987de

Please sign in to comment.