diff --git a/README.md b/README.md index 5f3e3de..aa71d30 100644 --- a/README.md +++ b/README.md @@ -7,16 +7,17 @@ A simple Python library to create and manage Windows mutexes. You can install the library using pip: ```bash -pip install pywinmutex +pip install winmutex ``` ## Usage ### Basic Example -```python -from pywinmutex import WindowsMutex -mutex = WindowsMutex("anidev/pywinmutex/simple", True) # Name may be any string +```python +from winmutex import WindowsMutex + +mutex = WindowsMutex("anidev/winmutex/simple", True) # Name may be any string mutex.timeout = 2500 # Set a timeout of 2.5 seconds with mutex: @@ -27,10 +28,11 @@ print(f"[I] Mutex({mutex}) released. Exiting...") ``` ### Legacy -```python -from pywinmutex import WindowsMutex -mutex = WindowsMutex("anidev/pywinmutex/acquire", True) # Name may be any string +```python +from winmutex import WindowsMutex + +mutex = WindowsMutex("anidev/winmutex/acquire", True) # Name may be any string if not mutex.acquire(5000): # Acquire the mutex with a timeout of 5 seconds; None for no timeout print(f"[W] Mutex({mutex}) already exists or acquire timeout exceeded.") diff --git a/examples/acquire.py b/examples/acquire.py index 3c06f38..e05c3fe 100644 --- a/examples/acquire.py +++ b/examples/acquire.py @@ -1,6 +1,6 @@ -from pywinmutex import WindowsMutex +from winmutex import WindowsMutex -mutex = WindowsMutex("anidev/pywinmutex/acquire", True) # Name may be any string +mutex = WindowsMutex("anidev/winmutex/acquire", True) # Name may be any string if not mutex.acquire(5000): # Acquire the mutex with a timeout of 5 seconds; None for no timeout print(f"[W] Mutex({mutex}) already exists or acquire timeout exceeded.") diff --git a/examples/find_index.py b/examples/find_index.py index 48ef8ad..ab9ea3e 100644 --- a/examples/find_index.py +++ b/examples/find_index.py @@ -1,4 +1,4 @@ -from pywinmutex import WindowsMutex +from winmutex import WindowsMutex mutex_name = "anidev.myapp.mutex.{}" # Name constructor mutex = WindowsMutex(mutex_name.format(0), True) diff --git a/examples/simple.py b/examples/simple.py index 41138e1..1e5f5a2 100644 --- a/examples/simple.py +++ b/examples/simple.py @@ -1,6 +1,6 @@ -from pywinmutex import WindowsMutex +from winmutex import WindowsMutex -mutex = WindowsMutex("anidev/pywinmutex/simple", True) # Name may be any string +mutex = WindowsMutex("anidev/winmutex/simple", True) # Name may be any string mutex.timeout = 2500 # Set a timeout of 2.5 seconds with mutex: diff --git a/main.py b/main.py index 48ef8ad..ab9ea3e 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,4 @@ -from pywinmutex import WindowsMutex +from winmutex import WindowsMutex mutex_name = "anidev.myapp.mutex.{}" # Name constructor mutex = WindowsMutex(mutex_name.format(0), True) diff --git a/pyproject.toml b/pyproject.toml index e2d615a..fde9235 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] -name = "pywinmutex" -version = "0.1.0" +name = "winmutex" +version = "1.0.0" description = "Simple handling mutexes with pywin32" authors = [ {name = "SantaSpeen",email = "santaspeen@gmail.com"} diff --git a/pywinmutex/__init__.py b/winmutex/__init__.py similarity index 100% rename from pywinmutex/__init__.py rename to winmutex/__init__.py