-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from jbarlow-mcafee/python_3
Python 3 support
- Loading branch information
Showing
35 changed files
with
1,300 additions
and
56 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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 |
---|---|---|
@@ -1,42 +1,50 @@ | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
import os | ||
# pylint: disable=no-name-in-module, import-error | ||
from distutils.dir_util import remove_tree | ||
from shutil import copyfile | ||
|
||
|
||
def clean_dir(directory): | ||
def clean_dir(src_dir, directory): | ||
if os.path.exists(directory): | ||
print("Cleaning directory: " + directory + "\n") | ||
for f in os.listdir(directory): | ||
if not os.path.isdir(os.path.join(directory, f)) \ | ||
and not f.lower().endswith(".dist") and not f.lower().endswith(".py"): | ||
target_file = os.path.join(directory, f) | ||
if not os.path.isdir(target_file) and not f.lower().endswith(".py"): | ||
os.remove(os.path.join(directory, f)) | ||
for f in os.listdir(directory): | ||
if not os.path.isdir(f) and f.lower().endswith(".dist"): | ||
copyfile(os.path.join(directory, f), os.path.join(directory, f[:-5])) | ||
|
||
for f in os.listdir(src_dir): | ||
src_file = os.path.join(src_dir, f) | ||
if not os.path.isdir(src_file) and \ | ||
not(f.lower().endswith(".py") or f.lower().endswith(".pyc")): | ||
copyfile(src_file, os.path.join(directory, f)) | ||
|
||
print("Starting clean.\n") | ||
|
||
DIST_PY_FILE_LOCATION = os.path.dirname(os.path.realpath(__file__)) | ||
DIST_DIRECTORY = os.path.join(DIST_PY_FILE_LOCATION, "dist") | ||
CONFIG_DIRECTORY = os.path.join(DIST_PY_FILE_LOCATION, "config") | ||
SAMPLE_DIRECTORY = os.path.join(DIST_PY_FILE_LOCATION, "sample") | ||
CONFIG_SRC_DIRECTORY = os.path.join(DIST_PY_FILE_LOCATION, "dxlciscopxgridclient", | ||
"_config", "app") | ||
SAMPLE_SRC_DIRECTORY = os.path.join(DIST_PY_FILE_LOCATION, "dxlciscopxgridclient", | ||
"_config", "sample") | ||
|
||
# Remove the dist directory if it exists | ||
if os.path.exists(DIST_DIRECTORY): | ||
print("Removing dist directory: " + DIST_DIRECTORY + "\n") | ||
remove_tree(DIST_DIRECTORY, verbose=1) | ||
|
||
# Clean the config directory | ||
clean_dir(CONFIG_DIRECTORY) | ||
clean_dir(CONFIG_SRC_DIRECTORY, CONFIG_DIRECTORY) | ||
|
||
# Clean the samples directory | ||
clean_dir(SAMPLE_DIRECTORY) | ||
clean_dir(SAMPLE_SRC_DIRECTORY, SAMPLE_DIRECTORY) | ||
|
||
# Clean .pyc files | ||
print("Cleaning .pyc files") | ||
for root, dirs, files in os.walk(DIST_PY_FILE_LOCATION): | ||
for file in files: | ||
full_path = os.path.join(root, file) | ||
for source_file in files: | ||
full_path = os.path.join(root, source_file) | ||
if full_path.lower().endswith(".pyc"): | ||
os.remove(full_path) |
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
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
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,2 @@ | ||
[parsers] | ||
smart_quotes = False |
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
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
Empty file.
Empty file.
File renamed without changes.
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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.1.2" | ||
__version__ = "0.2.0" |
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
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
2 changes: 2 additions & 0 deletions
2
sample/basic/basic_anc_apply_endpoint_policy_by_ip_example.py
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
import os | ||
import sys | ||
|
||
|
2 changes: 2 additions & 0 deletions
2
sample/basic/basic_anc_apply_endpoint_policy_by_mac_example.py
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
import os | ||
import sys | ||
|
||
|
2 changes: 2 additions & 0 deletions
2
sample/basic/basic_anc_apply_endpoint_policy_notification_example.py
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
import os | ||
import sys | ||
import time | ||
|
2 changes: 2 additions & 0 deletions
2
sample/basic/basic_anc_clear_endpoint_policy_by_ip_example.py
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
import os | ||
import sys | ||
|
||
|
2 changes: 2 additions & 0 deletions
2
sample/basic/basic_anc_clear_endpoint_policy_by_mac_example.py
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
import os | ||
import sys | ||
|
||
|
2 changes: 2 additions & 0 deletions
2
sample/basic/basic_anc_clear_endpoint_policy_notification_example.py
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
import os | ||
import sys | ||
import time | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
import os | ||
import sys | ||
import time | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
import os | ||
import sys | ||
import time | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
import os | ||
import sys | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
import os | ||
import sys | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
import os | ||
import sys | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
import os | ||
import sys | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
import os | ||
import sys | ||
import time | ||
|
2 changes: 2 additions & 0 deletions
2
sample/basic/basic_eps_send_mitigation_action_by_ip_example.py
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
import os | ||
import sys | ||
|
||
|
2 changes: 2 additions & 0 deletions
2
sample/basic/basic_eps_send_mitigation_action_by_mac_example.py
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
import os | ||
import sys | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
import os | ||
import sys | ||
import time | ||
|
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
Oops, something went wrong.