Skip to content

Commit fa71274

Browse files
author
Frederick Ross
committed
Made the relative path better formed and cross platform friendly in the examples.
1 parent 7965b65 commit fa71274

33 files changed

+33
-33
lines changed

examples/analytics/input.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# under the License.
1616

1717
import sys, os
18-
sys.path.insert(0, os.path.join(__file__, "../.."))
18+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
1919
from datetime import datetime
2020
import splunklib.client as client
2121

examples/analytics/output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# under the License.
1616

1717
import sys, os
18-
sys.path.insert(0, os.path.join(__file__, "../.."))
18+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
1919
import splunklib.client as client
2020
import splunklib.results as results
2121
try:

examples/analytics/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# under the License.
1616

1717
import sys, os
18-
sys.path.insert(0, os.path.join(__file__, "../.."))
18+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
1919

2020
from bottle import route, run, debug, template, static_file, request
2121

examples/async/async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
import sys, os, datetime
2424
import urllib
25-
sys.path.insert(0, os.path.join(__file__, "../.."))
25+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
2626

2727
import splunklib.binding as binding
2828
import splunklib.client as client

examples/binding1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
entities and 'method-like' endpoints."""
2121

2222
import sys, os
23-
sys.path.insert(0, os.path.join(__file__, "../"))
23+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
2424

2525
from splunklib.binding import connect
2626

examples/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"""Create, delete or list stanza information from/to Splunk confs."""
1818

1919
import sys, os
20-
sys.path.insert(0, os.path.join(__file__, "../"))
20+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
2121

2222
from splunklib.client import connect
2323

examples/dashboard/feed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
import sys, os, urllib2, json
24-
sys.path.insert(0, os.path.join(__file__, "../.."))
24+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
2525
from xml.etree import ElementTree
2626

2727
import splunklib.client as client

examples/event_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"""A command line utility that lists Splunk event types."""
1818

1919
import sys, os
20-
sys.path.insert(0, os.path.join(__file__, "../"))
20+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
2121

2222
from splunklib.client import connect
2323

examples/explorer/explorer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import sys
2020
import os
2121

22-
sys.path.insert(0, os.path.join(__file__, "../.."))
22+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
2323

2424
try:
2525
import utils

examples/export/export.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
# installation support files
2323
import sys, os
24-
sys.path.insert(0, os.path.join(__file__, "../.."))
24+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
2525
import time
2626
from os import path
2727

0 commit comments

Comments
 (0)