Skip to content

Fix: Resolve path-related issues in reminder module - #42

Open
Shreyaav18 wants to merge 1 commit into
Arpitgarg07:mainfrom
Shreyaav18:fix/path-related-issues
Open

Fix: Resolve path-related issues in reminder module#42
Shreyaav18 wants to merge 1 commit into
Arpitgarg07:mainfrom
Shreyaav18:fix/path-related-issues

Conversation

@Shreyaav18

Copy link
Copy Markdown

Description

Fixed multiple path-related and import issues that were causing ModuleNotFoundError and FileNotFoundError.

  • Remove remindme() call at module import level
  • Fix jarvisremind.mp3 path to use absolute path
  • Correct import paths for SearchNow module (from features.search.SearchNow)
  • Fix battery module import path (moved from utilities to system)
  • Prevent FileNotFoundError on module import

Rationale for this change

Multiple import and path issues were causing the application to crash on startup:

  1. The reminder.py module was calling remindme() at import time, causing unexpected execution
  2. Audio file path was relative and incorrect, leading to FileNotFoundError
  3. SearchNow imports were using incorrect paths (missing features.search. prefix)
  4. Battery module was incorrectly imported from features.utilities instead of features.system

What changes are included in this PR?

  1. core/Jarvismain.py:

    • Fixed import path: from features.search.SearchNow import searchGoogle, searchyoutube, searchwikipedia
    • Fixed import path: from features.system.battery import check_battery, battery (changed from utilities to system)
  2. features/utilities/reminder.py:

    • Removed the remindme() function call at module level (line 50)
    • Updated audio file path from relative "jarvisremind.mp3" to absolute path using os.path.join()
    • Added file existence check before attempting to play audio
  3. Project structure alignment: Ensured all imports match the actual directory structure:

  4. Are these changes tested?

  • Tested module imports - no ModuleNotFoundError
  • Tested reminder functionality - no FileNotFoundError
  • Verified SearchNow functions work correctly (Google, YouTube, Wikipedia search)
  • Application starts successfully
Screenshot 2025-10-10 005209

Manual testing performed by running:

python Jarvismain.py

- Remove remindme() call at module import level
- Fix jarvisremind.mp3 path to use absolute path
- Add missing audio file to assets/media directory
- Prevent FileNotFoundError on module import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant