catocli 3.0.1__py3-none-any.whl → 3.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of catocli might be problematic. Click here for more details.

catocli/__init__.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "3.0.1"
1
+ __version__ = "3.0.2"
2
2
  __cato_host__ = "https://api.catonetworks.com/api/v1/graphql2"
@@ -49,7 +49,31 @@ def generate_template(args):
49
49
  try:
50
50
  # Get the directory of this script to locate templates
51
51
  script_dir = os.path.dirname(os.path.abspath(__file__))
52
- templates_dir = os.path.join(script_dir, '..', '..', '..', '..', 'templates')
52
+
53
+ # Try multiple possible template directory locations
54
+ # 1. Development mode: go up 4 directories
55
+ # 2. Installed package: templates should be in the package root
56
+ possible_template_dirs = [
57
+ os.path.join(script_dir, '..', '..', '..', '..', 'templates'), # Development
58
+ os.path.join(os.path.dirname(script_dir.split('catocli')[0]), 'catocli', 'templates'), # Installed package
59
+ ]
60
+
61
+ templates_dir = None
62
+ for potential_dir in possible_template_dirs:
63
+ normalized_dir = os.path.normpath(potential_dir)
64
+ if os.path.exists(normalized_dir):
65
+ templates_dir = normalized_dir
66
+ break
67
+
68
+ if templates_dir is None:
69
+ # Fallback: look for templates directory in catocli package
70
+ import catocli
71
+ catocli_root = os.path.dirname(os.path.abspath(catocli.__file__))
72
+ fallback_templates_dir = os.path.join(catocli_root, 'templates')
73
+ if os.path.exists(fallback_templates_dir):
74
+ templates_dir = fallback_templates_dir
75
+ else:
76
+ raise Exception(f"Templates directory not found. Searched locations: {possible_template_dirs} and {fallback_templates_dir}")
53
77
 
54
78
  # Get the template format from export_format argument (defaults to json)
55
79
  template_format = getattr(args, 'export_format', 'json')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: catocli
3
- Version: 3.0.1
3
+ Version: 3.0.2
4
4
  Summary: Cato Networks cli wrapper for the GraphQL API.
5
5
  Home-page: https://github.com/Cato-Networks/cato-cli
6
6
  Author: Cato Networks
@@ -1,4 +1,4 @@
1
- catocli/__init__.py,sha256=ggP6bSf8rSvqJC-7CtGguzNcK1OCyPUI7aBVQezDjNw,84
1
+ catocli/__init__.py,sha256=2XLOXyrteS38EdDU8Rdapr0HJdmnvOI8FsQ3oo0nJAo,84
2
2
  catocli/__main__.py,sha256=6Z0ns_k_kUcz1Qtrn1u7UyUnqB-3e85jM_nppOwFsv4,217
3
3
  catocli/clisettings.json,sha256=s0NENqEgRtSzX8eJGASfOygI6cueF6mcPWSxj_oWMV4,964
4
4
  catocli/Utils/clidriver.py,sha256=lzVs1nYAiStwQjNxioxktwaKmfOF69Mmp5-9aWwsNOY,15972
@@ -16,7 +16,7 @@ catocli/parsers/custom/eventsFeedEnhanced.py,sha256=t5vPVWBSl57CO6a3UVRyx4292YaX
16
16
  catocli/parsers/custom/export_rules/__init__.py,sha256=vst8auriTCLwy5AT2_ySM2puq3PIg920ZWa5yy03K_8,1813
17
17
  catocli/parsers/custom/export_rules/export_rules.py,sha256=gXig4NC29yC5nW48ri-j0FEnaTz_kxKiuLF5y-5fZ_4,15646
18
18
  catocli/parsers/custom/export_sites/__init__.py,sha256=WAiaVzSGG8tsfWjl-FcUY2JyhfjE1sA265rtIsbmeVI,2427
19
- catocli/parsers/custom/export_sites/export_sites.py,sha256=abHr_jBJLWl2keP-pPqqmIQCI8xvK--2iPxSqB6Fhic,80964
19
+ catocli/parsers/custom/export_sites/export_sites.py,sha256=CTGe-xXvs6cLThiyuQUyFKz2bLUkwscM2eMytKFg-Bo,82160
20
20
  catocli/parsers/custom/import_rules_to_tf/__init__.py,sha256=jFCFceFv8zDW7nGLZOXkFE6NXAMPYRwKQwTbhSawYdM,3908
21
21
  catocli/parsers/custom/import_rules_to_tf/import_rules_to_tf.py,sha256=WlyTDxUtWchu9CDs73ILHDfNXCAh7jFARBEKk5WWhwM,18714
22
22
  catocli/parsers/custom/import_sites_to_tf/__init__.py,sha256=1ayoaaKIxWf5JBN62CO9F7-yaP9MqizTBCedqCyEc4k,4339
@@ -395,7 +395,7 @@ catocli/parsers/query_xdr_stories/README.md,sha256=rRW1pTmVMr9-j21-_MWNlozTTQnhi
395
395
  catocli/parsers/query_xdr_story/README.md,sha256=Fl2HutndHVobrj73Wh5NlTLq56tvVN3W0iib6BuO-b0,925
396
396
  catocli/parsers/raw/README.md,sha256=qvDLcg7U12yqacIQStOPtkqTsTLltJ06SSVmbqvlZhY,739
397
397
  catocli/parsers/raw/__init__.py,sha256=fiSzQzNSG3vje-eEXuOcdhuL8pyavkufocOJumjdFXs,1356
398
- catocli-3.0.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
398
+ catocli-3.0.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
399
399
  graphql_client/__init__.py,sha256=2nxD4YsWoOnALXi5cXbmtIN_i0NL_eyDTQRTxs52mkI,315
400
400
  graphql_client/api_client.py,sha256=2Rc1Zo1xH9Jnk1AO68kLSofTShkZwSVF-WkVtczfIc4,5786
401
401
  graphql_client/api_client_types.py,sha256=dM3zl6FA5SSp6nR6KmLfTL1BKaXX9uPMCZAm4v_FiUs,11569
@@ -743,8 +743,8 @@ vendor/urllib3/util/timeout.py,sha256=4eT1FVeZZU7h7mYD1Jq2OXNe4fxekdNvhoWUkZusRp
743
743
  vendor/urllib3/util/url.py,sha256=wHORhp80RAXyTlAIkTqLFzSrkU7J34ZDxX-tN65MBZk,15213
744
744
  vendor/urllib3/util/util.py,sha256=j3lbZK1jPyiwD34T8IgJzdWEZVT-4E-0vYIJi9UjeNA,1146
745
745
  vendor/urllib3/util/wait.py,sha256=_ph8IrUR3sqPqi0OopQgJUlH4wzkGeM5CiyA7XGGtmI,4423
746
- catocli-3.0.1.dist-info/METADATA,sha256=vtZrZQc_EQnc-eAvOxhRjhRvCEPMKVjR2FZRhsuTbYk,1286
747
- catocli-3.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
748
- catocli-3.0.1.dist-info/entry_points.txt,sha256=p4k9Orre6aWcqVrNmBbckmCs39h-1naMxRo2AjWmWZ4,50
749
- catocli-3.0.1.dist-info/top_level.txt,sha256=F4qSgcjcW5wR9EFrO8Ud06F7ZQGFr04a9qALNQDyVxU,52
750
- catocli-3.0.1.dist-info/RECORD,,
746
+ catocli-3.0.2.dist-info/METADATA,sha256=WBNjBRO067-ugVqLqOws5-bhDiPithFoLabdDzKqwug,1286
747
+ catocli-3.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
748
+ catocli-3.0.2.dist-info/entry_points.txt,sha256=p4k9Orre6aWcqVrNmBbckmCs39h-1naMxRo2AjWmWZ4,50
749
+ catocli-3.0.2.dist-info/top_level.txt,sha256=F4qSgcjcW5wR9EFrO8Ud06F7ZQGFr04a9qALNQDyVxU,52
750
+ catocli-3.0.2.dist-info/RECORD,,