Skip to content

Commit

Permalink
Merge pull request #30 from sudiptob2/patch/29-pwd-import-fix
Browse files Browse the repository at this point in the history
Patch/29 pwd import fix
  • Loading branch information
sudiptob2 authored Sep 30, 2022
2 parents d2c56b5 + c476045 commit 5db44e4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,10 @@ Fix:

Fix:

- Notification not working when `leeteasy` is scheduled with cronjob
- Notification not working when `leeteasy` is scheduled with cronjob

## 1.0.2 (Alpha)

Fix:

- `import pwd` fix for windows.
8 changes: 6 additions & 2 deletions leeteasy/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import pwd
import time as clock
from sys import platform

import click
import schedule
Expand Down Expand Up @@ -54,5 +54,9 @@ def execute_root():
execute_root.add_command(execute_stop)

if __name__ == '__main__':
os.environ['DBUS_SESSION_BUS_ADDRESS'] = f'unix:path=/run/user/{pwd.getpwuid(os.getuid()).pw_uid}/bus'
if platform != 'win32':
import pwd

os.environ[
'DBUS_SESSION_BUS_ADDRESS'] = f'unix:path=/run/user/{pwd.getpwuid(os.getuid()).pw_uid}/bus' # NOQA: E501
execute_root()
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = leeteasy
version = 1.0.1
version = 1.0.2
author = Sudipto Baral
author_email = [email protected]
description = Desktop notification of easy daily challenge of leetcode.
Expand Down

0 comments on commit 5db44e4

Please sign in to comment.