k4d3 commited on
Commit
bbf0244
·
1 Parent(s): f162c21

Enhance remove_grandfathered.py by adding parent directory to Python path

Browse files

This commit updates the remove_grandfathered.py script to include the parent directory in the Python path, allowing for improved module accessibility. Key changes include:
- Imported the os and sys modules.
- Appended the parent directory to the Python path for better import handling.

These adjustments facilitate the script's functionality and ensure it can locate necessary modules more effectively.

Files changed (1) hide show
  1. utils/remove_grandfathered.py +5 -1
utils/remove_grandfathered.py CHANGED
@@ -1,10 +1,14 @@
1
  #!/usr/bin/env python
2
  # -*- coding: utf-8 -*-
3
  #
 
 
 
 
 
4
  from utils.file_processor import FileProcessor, ProcessorOptions
5
  import re
6
  from pathlib import Path
7
- import sys
8
 
9
  class GrandfatheredRemovalProcessor(FileProcessor):
10
  def __init__(self, options: ProcessorOptions, pattern: str):
 
1
  #!/usr/bin/env python
2
  # -*- coding: utf-8 -*-
3
  #
4
+ import os
5
+ import sys
6
+ # Add the parent directory to the Python path
7
+ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
8
+
9
  from utils.file_processor import FileProcessor, ProcessorOptions
10
  import re
11
  from pathlib import Path
 
12
 
13
  class GrandfatheredRemovalProcessor(FileProcessor):
14
  def __init__(self, options: ProcessorOptions, pattern: str):