# -*- coding: utf-8 -*- u'''Print L{pycocoa} all public attributes, PyCocoa version, Python release, etc. by using C{python -m pycocoa [-all]} from the command line. ''' import sys from pycocoa import __all__ as _all_, _locals, _pycocoa as _package from pycocoa.utils import _all_listing, _all_versions, _Python3 # PYCHOK expected if _Python3: # get pycocoa.__all__ from .lazily from pycocoa import * # PYCHOK expected _all_versions(_file_=_package) if len(sys.argv) > 1 and '-all'.startswith(sys.argv[-1]): _all_listing(_all_, _locals(), libs=True, _file_=_package) from pycocoa.runtime import _nsDeallocObserverIvar1 _nsDeallocObserverIvar1() # check the _NSDeallocObserver class __all__ = () __version__ = '21.11.04' # % python3 -m pycocoa # pycocoa.version 21.11.04, .isLazy 1, Python 3.10.0 64bit arm64, macOS 12.0.1 # % python3.9 -m pycocoa # pycocoa.version 21.11.04, .isLazy 1, Python 3.9.6 64bit arm64, macOS 12.0.1 # % python3.8 -m pycocoa # pycocoa.version 21.11.4, .isLazy 1, Python 3.8.10 64bit arm64_x86_64, macOS 10.16
''' self._set.symmetric_difference_update(other) def update(self, *others): # |= '''Like C{set.update}. ''' self._set.update(*others) NSSet._Type = _Types.FrozenSet = FrozenSet NSMutableSet._Type = _Types.Set = Set if __name__ == '__main__': from pycocoa.utils import _all_listing _all_listing(__all__, locals(), __version__, __file__) # MIT License <https://OpenSource.org/licenses/MIT> # # Copyright (C) 2017-2020 -- mrJean1 at Gmail -- All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. #
Screens = Screens() # PYCHOK tuple-like, singleton _Types.Screen = NSScreen._Type = Screen if __name__ == '__main__': from pycocoa.utils import _all_listing, printf for s in tuple(Screens) + (Screens.Deepest, Screens.Main): printf(str(s), nl=1) for a in ('colorSpace', 'displayID', 'frame', 'named', 'pixels', 'ratio', 'resolutions', 'visibleFrame'): printf(' %s: %r', a, getattr(s, a, None)) _all_listing(__all__, locals()) # % python3 -m pycocoa.screens # # pycocoa BuiltInScreen(NSScreen, name='BuiltIn') # pycocoa colorSpace: 'NSCalibratedRGBColorSpace' # pycocoa displayID: 1 # pycocoa frame: Rect(origin=Point(x=0.0, y=0.0), size=Size(width=1440.0, height=900.0)) at 0x101332a90 # pycocoa named: 'Built-in Retina Display' # pycocoa pixels: Size(width=2560.0, height=1600.0) at 0x101332dc0 # pycocoa ratio: (8, 5) # pycocoa resolutions: Size(width=144.0, height=144.0) at 0x101332df0 # pycocoa visibleFrame: Rect(origin=Point(x=0.0, y=0.0), size=Size(width=1440.0, height=875.0)) at 0x101332fd0 # # pycocoa ExternalScreen(NSScreen, name='External') # pycocoa colorSpace: 'NSCalibratedRGBColorSpace'
# -*- coding: utf-8 -*- u'''Print L{pycocoa} version, etc. using C{python -m pycocoa}. ''' from pycocoa import __all__, version, _locals from pycocoa.utils import _all_listing # PYCHOK expected _all_listing(__all__, _locals(), version=version, filename='pycocoa') from pycocoa.runtime import _nsDeallocObserverIvar1 _nsDeallocObserverIvar1() __all__ = () __version__ = '20.01.08' # MIT License <https://OpenSource.org/licenses/MIT> # # Copyright (C) 2018-2019 -- mrJean1 at Gmail -- All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,