-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving code into module and added unittests
- Loading branch information
0 parents
commit 23ac288
Showing
8 changed files
with
677 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# osxmetadata Authors | ||
|
||
## Rhet Turnbull | ||
|
||
* Personal website: https://github.com/RhetTbull | ||
* EMail: rturnbull+git [:AT:] gmail [:DOT:] com | ||
* Location: California, USA | ||
* Twitter: @RhetTurnbull | ||
* Github: RhetTbull |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright | ||
|
||
Copyright © 2018, Rhet Turnbull <[rturnbull+git@gmail.com](https://github.com/RhetTbull)><br> | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, | ||
are permitted provided that the following conditions are met: | ||
|
||
<span><!-- To avoid code block getting part of the list --></span> | ||
|
||
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, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
### License ### | ||
|
||
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, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
osxmetadata [![Build Status]()](https://github.com/RhetTbull/osxmetadata) | ||
======== | ||
|
||
What is osxmetadata? | ||
----------------- | ||
|
||
zzz OSDetect is a small python module which is able to get some information | ||
about your system and python implementation, like the Operating System | ||
or the hardware platform. | ||
|
||
Supported operating systems | ||
--------------------------- | ||
|
||
As of now, only GNU/Linux, Mac OS X, Windows NT and Windows NT/Cygwin are supported. At the | ||
moment, I'm working on support for a wider range of operating systems. | ||
|
||
Since version 1.1.0, Python 2 and Python 3 are both supported. | ||
|
||
Note that the information available on the different platforms may differ. | ||
|
||
Installation instructions | ||
------------------------- | ||
|
||
Since OSDetect uses setuptools, you simply need to run | ||
|
||
python setup.py install | ||
|
||
Command Line Usage | ||
------------------ | ||
|
||
OSDetect includes a function which is executed if the module is directly called. So give it | ||
a try and run: | ||
|
||
python -m OSDetect | ||
|
||
Example uses of the module | ||
-------------------------- | ||
|
||
```python | ||
# Get a dict containing all gathered information | ||
from OSDetect import info as os_info | ||
print(os_info.getInfo()) | ||
|
||
# Get a specific value | ||
print(os_info.getDistribution()) | ||
# or using the dict key (a dot means a dict containing a dict) | ||
print(os_info.get("Python.Version")) | ||
``` | ||
|
||
On a ArchLinux system, it looks like this: | ||
|
||
```python | ||
{ | ||
'Python': { | ||
'Version': '3.6.0', | ||
'Implementation': 'CPython' | ||
}, | ||
'Machine': 'i686', | ||
'OS': 'Linux', | ||
'OSVersion': '4.10.6-1-ARCH', | ||
'Distribution': 'Arch Linux' | ||
} | ||
|
||
'ArchLinux' | ||
'3.6.0' | ||
``` |
Oops, something went wrong.