-
Notifications
You must be signed in to change notification settings - Fork 0
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 #1 from cisco-en-programmability/migration-to-en-p…
…rogrammability en-programmability migration
- Loading branch information
Showing
14 changed files
with
1,277 additions
and
1,224 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -482,11 +482,11 @@ except ManagerHTTPError as error: | |
|
||
``` | ||
|
||
## [Supported API endpoints](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/ENDPOINTS.md) | ||
## [Supported API endpoints](https://github.com/cisco-en-programmability/catalystwan-sdk/blob/main/ENDPOINTS.md) | ||
|
||
|
||
## [Contributing, bug reporting and feature requests](https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/CONTRIBUTING.md) | ||
## [Contributing, bug reporting and feature requests](https://github.com/cisco-en-programmability/catalystwan-sdk/blob/main/CONTRIBUTING.md) | ||
|
||
## Seeking support | ||
|
||
You can contact us by submitting [issues](https://github.com/cisco-open/cisco-catalyst-wan-sdk/issues), or directly via mail on [email protected]. | ||
You can contact us by submitting [issues](https://github.com/cisco-en-programmability/catalystwan-sdk/issues), or directly via mail on [email protected]. |
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
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,41 @@ | ||
# Copyright 2024 Cisco Systems, Inc. and its affiliates | ||
|
||
import re | ||
from datetime import datetime | ||
from pathlib import Path | ||
|
||
COPYRIGHT_NOTICE = f"# Copyright {datetime.now().year} Cisco Systems, Inc. and its affiliates" | ||
COPYRIGHT_PATTERN = r"^#.*copyright.*cisco.*$" | ||
SUBDIRS = ["catalystwan", "examples"] | ||
|
||
|
||
def check_if_copyright_present(file_path): | ||
try: | ||
with file_path.open("r", encoding="utf-8") as file: | ||
first_line = file.readline().strip() | ||
if re.search(COPYRIGHT_PATTERN, first_line, re.IGNORECASE): | ||
return True | ||
except Exception as e: | ||
print(f"Error reading {file_path}: {e}") | ||
return False | ||
|
||
|
||
def scan_and_update(dir_path): | ||
directory = Path(dir_path) | ||
if not directory.is_dir(): | ||
print(f"The provided path '{dir_path}' is not a valid directory.") | ||
return | ||
|
||
for file_path in directory.rglob("*.py"): | ||
if file_path.stat().st_size == 0: | ||
continue | ||
if not check_if_copyright_present(file_path): | ||
with open(file_path, "r+") as file: | ||
content = file.read() | ||
file.seek(0) | ||
file.write(COPYRIGHT_NOTICE + "\n" + content) | ||
|
||
|
||
if __name__ == "__main__": | ||
for dir in SUBDIRS: | ||
scan_and_update(dir) |
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,10 +1,10 @@ | ||
[tool.poetry] | ||
name = "catalystwan" | ||
version = "0.36.1" | ||
version = "0.40.0" | ||
description = "Cisco Catalyst WAN SDK for Python" | ||
authors = ["kagorski <[email protected]>"] | ||
readme = "README.md" | ||
repository = "https://github.com/cisco-open/cisco-catalyst-wan-sdk" | ||
repository = "https://github.com/cisco-en-programmability/catalystwan-sdk" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.8.0" | ||
|