Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoLvs committed Feb 26, 2019
1 parent 0b3b965 commit 78f390e
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 0 deletions.
3 changes: 3 additions & 0 deletions create_wheel.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
python setup.py sdist bdist_wheel

pause
4 changes: 4 additions & 0 deletions magics/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .main import *

ip = get_ipython()
ip.register_magics(CustomMagics)
23 changes: 23 additions & 0 deletions magics/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from IPython.core import magic_arguments
from IPython.core.magic import line_magic, cell_magic, line_cell_magic, Magics, magics_class

import winsound
import os


@magics_class
class CustomMagics(Magics):

@line_magic
def alarm(self,line=""):
file = os.path.join(os.path.dirname(__file__),"static/alarm.wav")
print(f"... Launching alarm at {file}")
winsound.PlaySound(file, winsound.SND_FILENAME)


ip = get_ipython()
ip.register_magics(CustomMagics)


# def load_ipython_extension(ipython):
# ipython.register_magics(CustomMagics)
Binary file added magics/static/alarm.wav
Binary file not shown.
27 changes: 27 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Setup.py tutorial https://packaging.python.org/tutorials/packaging-projects/

import setuptools

with open("README.md", "r") as fh:
long_description = fh.read()

setuptools.setup(
name="magics",
version="0.0.1",
author="Theo Alves Da Costa",
author_email="theo.alves.da.costa@gmail.com",
description="A set of custom magics and tools for productivity",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/theolvs/jupyter-magics",
packages=setuptools.find_packages(),
package_data={'magics.static': ['*.wav']},
include_package_data=False,
install_requires=[
],
classifiers=(
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
),
)

0 comments on commit 78f390e

Please sign in to comment.