From a9bcc9c1de47f3d440d0c53385b3998d6e08a1db Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Thu, 23 Jun 2022 10:59:40 +0200 Subject: [PATCH] feat: Initialize App --- .gitignore | 6 + MANIFEST.in | 18 +++ README.md | 7 ++ license.txt | 1 + requirements.txt | 1 + setup.py | 19 +++ u_utils/__init__.py | 3 + u_utils/config/__init__.py | 0 u_utils/config/desktop.py | 12 ++ u_utils/config/docs.py | 11 ++ u_utils/hooks.py | 188 ++++++++++++++++++++++++++++ u_utils/modules.txt | 1 + u_utils/patches.txt | 0 u_utils/templates/__init__.py | 0 u_utils/templates/pages/__init__.py | 0 u_utils/u_utils/__init__.py | 0 16 files changed, 267 insertions(+) create mode 100644 .gitignore create mode 100644 MANIFEST.in create mode 100644 README.md create mode 100644 license.txt create mode 100644 requirements.txt create mode 100644 setup.py create mode 100644 u_utils/__init__.py create mode 100644 u_utils/config/__init__.py create mode 100644 u_utils/config/desktop.py create mode 100644 u_utils/config/docs.py create mode 100644 u_utils/hooks.py create mode 100644 u_utils/modules.txt create mode 100644 u_utils/patches.txt create mode 100644 u_utils/templates/__init__.py create mode 100644 u_utils/templates/pages/__init__.py create mode 100644 u_utils/u_utils/__init__.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d4334e2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.DS_Store +*.pyc +*.egg-info +*.swp +tags +u_utils/docs/current \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..3622475 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,18 @@ +include MANIFEST.in +include requirements.txt +include *.json +include *.md +include *.py +include *.txt +recursive-include u_utils *.css +recursive-include u_utils *.csv +recursive-include u_utils *.html +recursive-include u_utils *.ico +recursive-include u_utils *.js +recursive-include u_utils *.json +recursive-include u_utils *.md +recursive-include u_utils *.png +recursive-include u_utils *.py +recursive-include u_utils *.svg +recursive-include u_utils *.txt +recursive-exclude u_utils *.pyc \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..f1809c8 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +## u_utils + +Utilities packages, functions and so on for prints, notifications and more + +#### License + +GPLv3 \ No newline at end of file diff --git a/license.txt b/license.txt new file mode 100644 index 0000000..d964aaa --- /dev/null +++ b/license.txt @@ -0,0 +1 @@ +License: GPLv3 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..7668191 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +# frappe -- https://github.com/frappe/frappe is installed via 'bench init' \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..23a48ec --- /dev/null +++ b/setup.py @@ -0,0 +1,19 @@ +from setuptools import setup, find_packages + +with open("requirements.txt") as f: + install_requires = f.read().strip().split("\n") + +# get version from __version__ variable in u_utils/__init__.py +from u_utils import __version__ as version + +setup( + name="u_utils", + version=version, + description="Utilities packages, functions and so on for prints, notifications and more", + author="Unitoo", + author_email="info@unitoo.it", + packages=find_packages(), + zip_safe=False, + include_package_data=True, + install_requires=install_requires +) diff --git a/u_utils/__init__.py b/u_utils/__init__.py new file mode 100644 index 0000000..7a0660b --- /dev/null +++ b/u_utils/__init__.py @@ -0,0 +1,3 @@ + +__version__ = '0.0.1' + diff --git a/u_utils/config/__init__.py b/u_utils/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/u_utils/config/desktop.py b/u_utils/config/desktop.py new file mode 100644 index 0000000..7067144 --- /dev/null +++ b/u_utils/config/desktop.py @@ -0,0 +1,12 @@ +from frappe import _ + +def get_data(): + return [ + { + "module_name": "u_utils", + "color": "grey", + "icon": "octicon octicon-file-directory", + "type": "module", + "label": _("u_utils") + } + ] diff --git a/u_utils/config/docs.py b/u_utils/config/docs.py new file mode 100644 index 0000000..2dd8d10 --- /dev/null +++ b/u_utils/config/docs.py @@ -0,0 +1,11 @@ +""" +Configuration for docs +""" + +# source_link = "https://github.com/[org_name]/u_utils" +# docs_base_url = "https://[org_name].github.io/u_utils" +# headline = "App that does everything" +# sub_heading = "Yes, you got that right the first time, everything" + +def get_context(context): + context.brand_html = "u_utils" diff --git a/u_utils/hooks.py b/u_utils/hooks.py new file mode 100644 index 0000000..1356c86 --- /dev/null +++ b/u_utils/hooks.py @@ -0,0 +1,188 @@ +from . import __version__ as app_version + +app_name = "u_utils" +app_title = "u_utils" +app_publisher = "Unitoo" +app_description = "Utilities packages, functions and so on for prints, notifications and more" +app_icon = "octicon octicon-file-directory" +app_color = "grey" +app_email = "info@unitoo.it" +app_license = "GPLv3" + +# Includes in +# ------------------ + +# include js, css files in header of desk.html +# app_include_css = "/assets/u_utils/css/u_utils.css" +# app_include_js = "/assets/u_utils/js/u_utils.js" + +# include js, css files in header of web template +# web_include_css = "/assets/u_utils/css/u_utils.css" +# web_include_js = "/assets/u_utils/js/u_utils.js" + +# include custom scss in every website theme (without file extension ".scss") +# website_theme_scss = "u_utils/public/scss/website" + +# include js, css files in header of web form +# webform_include_js = {"doctype": "public/js/doctype.js"} +# webform_include_css = {"doctype": "public/css/doctype.css"} + +# include js in page +# page_js = {"page" : "public/js/file.js"} + +# include js in doctype views +# doctype_js = {"doctype" : "public/js/doctype.js"} +# doctype_list_js = {"doctype" : "public/js/doctype_list.js"} +# doctype_tree_js = {"doctype" : "public/js/doctype_tree.js"} +# doctype_calendar_js = {"doctype" : "public/js/doctype_calendar.js"} + +# Home Pages +# ---------- + +# application home page (will override Website Settings) +# home_page = "login" + +# website user home page (by Role) +# role_home_page = { +# "Role": "home_page" +# } + +# Generators +# ---------- + +# automatically create page for each record of this doctype +# website_generators = ["Web Page"] + +# Installation +# ------------ + +# before_install = "u_utils.install.before_install" +# after_install = "u_utils.install.after_install" + +# Uninstallation +# ------------ + +# before_uninstall = "u_utils.uninstall.before_uninstall" +# after_uninstall = "u_utils.uninstall.after_uninstall" + +# Desk Notifications +# ------------------ +# See frappe.core.notifications.get_notification_config + +# notification_config = "u_utils.notifications.get_notification_config" + +# Permissions +# ----------- +# Permissions evaluated in scripted ways + +# permission_query_conditions = { +# "Event": "frappe.desk.doctype.event.event.get_permission_query_conditions", +# } +# +# has_permission = { +# "Event": "frappe.desk.doctype.event.event.has_permission", +# } + +# DocType Class +# --------------- +# Override standard doctype classes + +# override_doctype_class = { +# "ToDo": "custom_app.overrides.CustomToDo" +# } + +# Document Events +# --------------- +# Hook on document methods and events + +# doc_events = { +# "*": { +# "on_update": "method", +# "on_cancel": "method", +# "on_trash": "method" +# } +# } + +# Scheduled Tasks +# --------------- + +# scheduler_events = { +# "all": [ +# "u_utils.tasks.all" +# ], +# "daily": [ +# "u_utils.tasks.daily" +# ], +# "hourly": [ +# "u_utils.tasks.hourly" +# ], +# "weekly": [ +# "u_utils.tasks.weekly" +# ] +# "monthly": [ +# "u_utils.tasks.monthly" +# ] +# } + +# Testing +# ------- + +# before_tests = "u_utils.install.before_tests" + +# Overriding Methods +# ------------------------------ +# +# override_whitelisted_methods = { +# "frappe.desk.doctype.event.event.get_events": "u_utils.event.get_events" +# } +# +# each overriding function accepts a `data` argument; +# generated from the base implementation of the doctype dashboard, +# along with any modifications made in other Frappe apps +# override_doctype_dashboards = { +# "Task": "u_utils.task.get_dashboard_data" +# } + +# exempt linked doctypes from being automatically cancelled +# +# auto_cancel_exempted_doctypes = ["Auto Repeat"] + + +# User Data Protection +# -------------------- + +user_data_fields = [ + { + "doctype": "{doctype_1}", + "filter_by": "{filter_by}", + "redact_fields": ["{field_1}", "{field_2}"], + "partial": 1, + }, + { + "doctype": "{doctype_2}", + "filter_by": "{filter_by}", + "partial": 1, + }, + { + "doctype": "{doctype_3}", + "strict": False, + }, + { + "doctype": "{doctype_4}" + } +] + +# Authentication and authorization +# -------------------------------- + +# auth_hooks = [ +# "u_utils.auth.validate" +# ] + +# Translation +# -------------------------------- + +# Make link fields search translated document names for these DocTypes +# Recommended only for DocTypes which have limited documents with untranslated names +# For example: Role, Gender, etc. +# translated_search_doctypes = [] diff --git a/u_utils/modules.txt b/u_utils/modules.txt new file mode 100644 index 0000000..dba7385 --- /dev/null +++ b/u_utils/modules.txt @@ -0,0 +1 @@ +u_utils \ No newline at end of file diff --git a/u_utils/patches.txt b/u_utils/patches.txt new file mode 100644 index 0000000..e69de29 diff --git a/u_utils/templates/__init__.py b/u_utils/templates/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/u_utils/templates/pages/__init__.py b/u_utils/templates/pages/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/u_utils/u_utils/__init__.py b/u_utils/u_utils/__init__.py new file mode 100644 index 0000000..e69de29