Skip to content

Commit

Permalink
Merge pull request #148 from MartinBernstorff/mb/add_monitoring
Browse files Browse the repository at this point in the history
add monitoring
  • Loading branch information
MartinBernstorff authored Oct 15, 2023
2 parents 19255eb + fa14c24 commit e0ad96f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.analysis.typeCheckingMode": "strict"
"python.analysis.typeCheckingMode": "strict",
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.formatting.provider": "none"
}
35 changes: 14 additions & 21 deletions application/main.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
#!/usr/bin/env python3
"""Ankdown: Convert Markdown files into anki decks.
Usage:
ankdown.py [-r DIR] [-p PACKAGENAME] [--updatedOnly] [--config CONFIG_STRING] [--configFile CONFIG_FILE_PATH]
Options:
-h --help Show this help message
--version Show version
-r DIR Recursively visit DIR, accumulating cards from `.md` files.
-p PACKAGE Instead of a .txt file, produce a .apkg file. recommended.
--updatedOnly Only generate cards from updated `.md` files
--config CONFIG_STRING ankdown configuration as YAML string
--configFile CONFIG_FILE_PATH path to ankdown configuration as YAML file
"""

import json
import urllib.request
from collections import defaultdict
from pathlib import Path
from typing import Any, Dict

import sentry_sdk
from docopt import docopt
from personal_mnemonic_medium.card_pipeline import CardPipeline
from personal_mnemonic_medium.exporters.anki.globals import (
Expand Down Expand Up @@ -101,7 +82,19 @@ def apply_arguments(arguments: Any) -> None:

def main():
"""Run the thing."""
apply_arguments(docopt(__doc__, version=VERSION))

sentry_sdk.init(
dsn="https://37f17d6aa7742424652663a04154e032@o4506053997166592.ingest.sentry.io/4506053999984640",
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
traces_sample_rate=1.0,
# Set profiles_sample_rate to 1.0 to profile 100%
# of sampled transactions.
# We recommend adjusting this value in production.
profiles_sample_rate=1.0,
)

apply_arguments(docopt(__doc__, version=VERSION)) # type: ignore
recur_dir = Path(CONFIG["recur_dir"])

cards = CardPipeline(
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies = [
"wasabi>=0.9.1",
"tqdm>=4.64.1",
"genanki>=0.13.0",
"sentry-sdk==1.32.0",
]

[project.optional-dependencies]
Expand Down

0 comments on commit e0ad96f

Please sign in to comment.