Git Product home page Git Product logo

zroya's Introduction

License: MIT PyPI version PyPI status Maintenance

zroya2

Zroya is a Python package for creating native Windows notifications.

In contrast to first version of zroya, zroya2 is a Python extension built around C++ WinToast library.

Note: Zroya2 is in beta testing. I would be grateful for any bug reports.

Prerequisites

There are no requirements at the moment.

Installation

Zroya2 is now available from pypi:

python -m pip install zroya

Example

import zroya

# Initialize zroya module. Make sure to call this function.
# All parameters are required
zroya.init("YourAppName", "CompanyName", "ProductName", "SubProduct", "Version")

# Create notification template. TYPE_TEXT1 means one bold line withou image.
template = zroya.Template( zroya.TemplateType.Text1 )
# Set first line
template.setFirstLine("My First line")

# Save notification id for later use
notificationID = zroya.show(template)

# .. do something, maybe sleep?

# Hide notification
zroya.hide(notificationID)

Documentation

You may find some limited documentation on Zroya Page

zroya's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

zroya's Issues

A logo for zroya?

Would really nice if you added a logo.

Not sure what zroya means. If I did, i would try to make one myself.

setExpiration() doesn't work

I set the template expiration to 1000, but the notification will closed after 5-6 seconds.
If i set the expiration to 10.000 the notification will closed after 5-6 seconds as well.

import time
import zroya


def _dismiss(action_id, reason):
    print(f"[_dismiss()] action_id: {action_id}")
    print(f"[_dismiss()] reason: {reason}")


def main():
    # Initialization is required
    zroya.init("asdf", "a", "b", "c", "1")

    template = zroya.Template(zroya.TemplateType.Text1)
    template.setExpiration(1000)

    zroya.show(template, on_dismiss=_dismiss)

    time.sleep(20)

if __name__ == '__main__':
    main()

I'm using python 3.7 with zroya 0.2.4.

zroya.hide bug

When i try hide notification, i get error:

import time
import zroya

zroya.init("abcd", "a", "b", "c", "1")
template = zroya.Template(zroya.TemplateType.Text1)
template.setFirstLine("Hello")

zroya_id = zroya.show(template)
time.sleep(1)
zroya.hide(zroya_id)
time.sleep(5)
Traceback (most recent call last):
  File "D:/Dropbox/Projects/Notifer/test1.py", line 10, in <module>
    zroya.hide(zroya_id)
SystemError: More keyword list entries (6) than format specifiers (1)

Example not working correctly

Hi,

Great project, there are many python windows projects that can use this !

you mention pypiwin32 in your readme, i just want to bring it to your attention that this is probably a fork of the original project pywin32

https://github.com/mhammond/pywin32

they are nearly identical still, but you should probably decide which has a better future

either way i tested with both libs and this was the error i get if execut your example

C:\Users\Username\Desktop>python notify.py
Python WNDPROC handler failed
Traceback (most recent call last):
  File "C:\Users\Username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\zroya-0.1.2-py3.6.egg\zroya\__init__.py", line 275, in _eventLoop
  File "C:\Users\Username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\zroya-0.1.2-py3.6.egg\zroya\__init__.py", line 248, in _onNotificationEvent
TypeError: 'NoneType' object is not callable

on clicking the notifaction

Python WNDPROC handler failed
Traceback (most recent call last):
  File "C:\Users\Username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\zroya-0.1.2-py3.6.egg\zroya\__init__.py", line 275, in _eventLoop
  File "C:\Users\Username\AppData\Local\Programs\Python\Python36-32\lib\site-packages\zroya-0.1.2-py3.6.egg\zroya\__init__.py", line 248, in _onNotificationEvent
TypeError: click_callback() missing 1 required positional argument: 'data'
```

Install errors on MSYS2

$ pip3 install git+https://github.com/malja/zroya.git
Collecting git+https://github.com/malja/zroya.git
  Cloning https://github.com/malja/zroya.git to c:/users/user/appdata/local/temp/pip-req-build-tju6m2a4
Building wheels for collected packages: zroya
  Running setup.py bdist_wheel for zroya ... error
  Complete output from command C:/msys64/mingw32/bin/python3.exe -u -c "import setuptools, tokenize;__file__='C:/Users/user/AppData/Local/Temp/pip-req-build-tju6m2a4/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:/Users/user/AppData/Local/Temp/pip-wheel-womx3zwx --python-tag cp36:
  running bdist_wheel
  running build
  running build_ext
  building '_zroya' extension
  creating build
  creating build/temp.mingw-3.6
  creating build/temp.mingw-3.6/module
  C:\msys64\mingw32\bin/i686-w64-mingw32-gcc.exe -Wno-unused-result -Wsign-compare -DNDEBUG -march=i686 -mtune=generic -O2 -pipe -fwrapv -D__USE_MINGW_ANSI_STDIO=1 -DNDEBUG -march=i686 -mtune=generic -O2 -pipe -fwrapv -D__USE_MINGW_ANSI_STDIO=1 -DNDEBUG -I./module -IC:/msys64/mingw32/include/python3.6m -c ./module/event_handler.cpp -o build/temp.mingw-3.6/./module/event_handler.o /utf-8
  i686-w64-mingw32-gcc: error: /utf-8: No such file or directory
  error: command 'C:\\msys64\\mingw32\\bin/i686-w64-mingw32-gcc.exe' failed with exit status 1

  ----------------------------------------
  Failed building wheel for zroya
  Running setup.py clean for zroya
Failed to build zroya
Installing collected packages: zroya
  Running setup.py install for zroya ... error
    Complete output from command C:/msys64/mingw32/bin/python3.exe -u -c "import setuptools, tokenize;__file__='C:/Users/user/AppData/Local/Temp/pip-req-build-tju6m2a4/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:/Users/user/AppData/Local/Temp/pip-record-a6jjlec6/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building '_zroya' extension
    creating build
    creating build/temp.mingw-3.6
    creating build/temp.mingw-3.6/module
    C:\msys64\mingw32\bin/i686-w64-mingw32-gcc.exe -Wno-unused-result -Wsign-compare -DNDEBUG -march=i686 -mtune=generic -O2 -pipe -fwrapv -D__USE_MINGW_ANSI_STDIO=1 -DNDEBUG -march=i686 -mtune=generic -O2 -pipe -fwrapv -D__USE_MINGW_ANSI_STDIO=1 -DNDEBUG -I./module -IC:/msys64/mingw32/include/python3.6m -c ./module/event_handler.cpp -o build/temp.mingw-3.6/./module/event_handler.o /utf-8
    i686-w64-mingw32-gcc: error: /utf-8: No such file or directory
    error: command 'C:\\msys64\\mingw32\\bin/i686-w64-mingw32-gcc.exe' failed with exit status 1

    ----------------------------------------
Command "C:/msys64/mingw32/bin/python3.exe -u -c "import setuptools, tokenize;__file__='C:/Users/user/AppData/Local/Temp/pip-req-build-tju6m2a4/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:/Users/user/AppData/Local/Temp/pip-record-a6jjlec6/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:/Users/user/AppData/Local/Temp/pip-req-build-tju6m2a4/

and via pypi

$ pip3 install zroya
Collecting zroya
  Using cached https://files.pythonhosted.org/packages/6a/7d/e61a4871e0e0789165260ea20b9acea29b6794d9e51286457ea3f2adc241/zroya-0.2.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:/Users/user/AppData/Local/Temp/pip-install-8tztgf4l/zroya/setup.py", line 6, in <module>
        from generate_stubs import GenerateStubFile
    ModuleNotFoundError: No module named 'generate_stubs'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:/Users/USER/AppData/Local/Temp/pip-install-8tztgf4l/zroya/

Stay up to date

Sorry for opening a issue about it, but do you have a blog or website where i can stay up to date with the development? For example when you think its ready for testing.

Specially interested int the zroya2 branch. Thanks

Persistent notifications?

Hi! I've been experimenting with zroya for a little bit and I'm having a problem. I want the notification to be persistent in the action center. Right now, the notification appears to dismiss itself after expanding the action center once. I'm not sure this is expected behavior. since it doesn't happen with apps like Mail.
Is there a way to do this? Attaching callbacks (on_click, on_dismiss) or actions doesn't seem to work. Setting a huge expiration time with setExpiration doesn't seem to work either.
Thank you for your work.
2019-04-17_15-21-22

Issue installing zroya using PIP

PIP install for this library does not appear to work correctly.
The install completes successfully, however the library was never actually installed.

zroya v0.1.0
Python v3.6
PIP v9.0.1
Windows 10.0.16299.309

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.