Skip to content

Commit 8f39a2d

Browse files
committed
Apply quick fixes and formatting
- Removed `.travis.yml` - Fixed `examples\run.py` - Fixed `examples\spawn.py` - Formatted `LICENSE.md` - Replaced "pypiwin32" with "pywin32" in `win-requirements.txt
1 parent 586c79f commit 8f39a2d

File tree

6 files changed

+12
-35
lines changed

6 files changed

+12
-35
lines changed

.travis.yml

-19
This file was deleted.

LICENSE renamed to LICENSE.md

File renamed without changes.

README.md

+9-13
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ If you're interested in learning more about osquery, visit the [GitHub project](
88

99
### What is osquery-python?
1010

11-
[![Build Status](https://travis-ci.org/osquery/osquery-python.svg?branch=master)](https://travis-ci.org/osquery/osquery-python)
12-
1311
In osquery, SQL tables, configuration retrieval, log handling, etc are implemented via a simple, robust plugin and extensions API. This project contains the official Python bindings for creating osquery extensions in Python. Consider the following example:
1412

1513
```python
@@ -116,13 +114,18 @@ Then use the Python bindings:
116114
```python
117115
import osquery
118116

117+
LINUX_THRIFT_SOCKET = '/var/osquery/osquery.em'
118+
WINDOWS_THRIFT_SOCKET = r'\\.\pipe\osquery.em'
119+
119120
if __name__ == "__main__":
120121
# You must know the Thrift socket path
121122
# For an installed and running system osqueryd, this is:
122123
# Linux and macOS: /var/osquery/osquery.em
123124
# FreeBSD: /var/run/osquery.em
124125
# Windows: \\.\pipe\osquery.em
125-
instance = osquery.ExtensionClient('/home/you/.osquery/osqueryd.sock')
126+
instance = osquery.ExtensionClient(WINDOWS_THRIFT_SOCKET \
127+
if sys.platform == 'win32' else LINUX_THRIFT_SOCKET)
128+
126129
instance.open() # This may raise an exception
127130

128131
# Issue queries and call osquery Thrift APIs.
@@ -132,17 +135,10 @@ if __name__ == "__main__":
132135

133136
### Install
134137

135-
To install from PyPi, run the following:
138+
To install from this repo, run the following:
136139

137-
```
138-
pip install osquery
139-
```
140-
141-
Alternatively, to install from this repo, run the following:
142-
143-
```
144-
python setup.py build
145-
python setup.py install
140+
```sh
141+
pip install git+https://github.com/outhex/osquery-python.git
146142
```
147143

148144

examples/run.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
for row in RESULTS.response:
2121
print("=" * 80)
22-
for key, val in row.iteritems():
22+
for key, val in row.items():
2323
print("%s => %s" % (key, val))
2424
if len(RESULTS.response) > 0:
2525
print("=" * 80)

examples/spawn.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
for row in RESULTS.response:
2121
print("=" * 80)
22-
for key, val in row.iteritems():
22+
for key, val in row.items():
2323
print("%s => %s" % (key, val))
2424
if len(RESULTS.response) > 0:
2525
print("=" * 80)

win-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pypiwin32
1+
pywin32

0 commit comments

Comments
 (0)