OSDN Git Service

Initial Release
authorYukidaruma-dev <yukir0dev@gmail.com>
Mon, 8 Apr 2019 05:57:39 +0000 (14:57 +0900)
committerYukidaruma-dev <yukir0dev@gmail.com>
Mon, 8 Apr 2019 05:57:39 +0000 (14:57 +0900)
.gitignore [new file with mode: 0644]
.vscode/launch.json [new file with mode: 0644]
.vscode/settings.json [new file with mode: 0644]
usr/bin/arrest [new file with mode: 0644]
usr/share/arrest/color.py [new file with mode: 0644]
usr/share/arrest/main.py [new file with mode: 0755]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..2e6cf00
--- /dev/null
@@ -0,0 +1,155 @@
+# Created by https://www.gitignore.io/api/linux,python,visualstudiocode
+# Edit at https://www.gitignore.io/?templates=linux,python,visualstudiocode
+
+### Linux ###
+*~
+
+# temporary files which can be created if a process still has a handle open of a deleted file
+.fuse_hidden*
+
+# KDE directory preferences
+.directory
+
+# Linux trash folder which might appear on any partition or disk
+.Trash-*
+
+# .nfs files are created when an open file is removed but is still being accessed
+.nfs*
+
+### Python ###
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+pip-wheel-metadata/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+#  Usually these files are written by a python script from a template
+#  before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+.hypothesis/
+.pytest_cache/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+.python-version
+
+# pipenv
+#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+#   However, in case of collaboration, if having platform-specific dependencies or dependencies
+#   having no cross-platform support, pipenv may install dependencies that don’t work, or not
+#   install all needed dependencies.
+#Pipfile.lock
+
+# celery beat schedule file
+celerybeat-schedule
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/
+
+### VisualStudioCode ###
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+
+### VisualStudioCode Patch ###
+# Ignore all local history of files
+.history
+
+# End of https://www.gitignore.io/api/linux,python,visualstudiocode
\ No newline at end of file
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644 (file)
index 0000000..26e1a88
--- /dev/null
@@ -0,0 +1,77 @@
+{
+    // IntelliSense を使用して利用可能な属性を学べます。
+    // 既存の属性の説明をホバーして表示します。
+    // 詳細情報は次を確認してください: https://go.microsoft.com/fwlink/?linkid=830387
+    "version": "0.2.0",
+    "configurations": [
+        {
+            "name": "Python: Module",
+            "type": "python",
+            "request": "launch",
+            "module": "enter-your-module-name-here",
+            "console": "integratedTerminal"
+        },
+        {
+            "name": "Python: Current File (Integrated Terminal)",
+            "type": "python",
+            "request": "launch",
+            "program": "${file}",
+            "console": "integratedTerminal"
+        },
+        {
+            "name": "Python: Remote Attach",
+            "type": "python",
+            "request": "attach",
+            "port": 5678,
+            "host": "localhost",
+            "pathMappings": [
+                {
+                    "localRoot": "${workspaceFolder}",
+                    "remoteRoot": "."
+                }
+            ]
+        },
+        {
+            "name": "Python: Module",
+            "type": "python",
+            "request": "launch",
+            "module": "enter-your-module-name-here",
+            "console": "integratedTerminal"
+        },
+        {
+            "name": "Python: Django",
+            "type": "python",
+            "request": "launch",
+            "program": "${workspaceFolder}/manage.py",
+            "console": "integratedTerminal",
+            "args": [
+                "runserver",
+                "--noreload",
+                "--nothreading"
+            ],
+            "django": true
+        },
+        {
+            "name": "Python: Flask",
+            "type": "python",
+            "request": "launch",
+            "module": "flask",
+            "env": {
+                "FLASK_APP": "app.py"
+            },
+            "args": [
+                "run",
+                "--no-debugger",
+                "--no-reload"
+            ],
+            "jinja": true
+        },
+        {
+            "name": "Python: Current File (External Terminal)",
+            "type": "python",
+            "request": "launch",
+            "program": "${file}",
+            "console": "externalTerminal"
+        }
+    ]
+}
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644 (file)
index 0000000..615aafb
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "python.pythonPath": "/usr/bin/python3"
+}
\ No newline at end of file
diff --git a/usr/bin/arrest b/usr/bin/arrest
new file mode 100644 (file)
index 0000000..c9c4329
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/bash
+python3 /usr/share/arrest/main.py
\ No newline at end of file
diff --git a/usr/share/arrest/color.py b/usr/share/arrest/color.py
new file mode 100644 (file)
index 0000000..ce56556
--- /dev/null
@@ -0,0 +1,33 @@
+class colors:
+#Style
+    bold = '\033[1m'
+    underlined = '\033[4m'
+#Color
+    black = '\033[30m'
+    red = '\033[31m'
+    green = '\033[32m'
+    yellow = '\033[33m'
+    blue = '\033[34m'
+    magenta = '\033[35m'
+    cyan = '\033[36m'
+    lgray = '\033[37m'
+    darkgray = '\033[90m'
+    lred = '\033[91m'
+    lgreen = '\033[92m'
+    lyellow = '\033[93m'
+    lblue = '\033[94m'
+    lmagenta = '\033[95m'
+    lcyan = '\033[96m'
+#Backgroundcolors
+    bground_black = '\033[40m'
+    bground_red = '\033[41m'
+    bground_green = '\033[42m'
+    bground_yellow = '\033[43m'
+    bground_blue = '\033[44m'
+    bground_magenta = '\033[45m'
+    bground_cyan = '\033[46m'
+#Reset All
+    reset = '\033[0m'
+#How to use?
+#from clicolors import colors
+#print(colors.red + "red text" + colors.reset)
\ No newline at end of file
diff --git a/usr/share/arrest/main.py b/usr/share/arrest/main.py
new file mode 100755 (executable)
index 0000000..feb2d21
--- /dev/null
@@ -0,0 +1,26 @@
+#!/usr/bin/env python3
+#Modules import
+from color import colors
+from time import sleep
+
+#setting
+auth = True
+message_loop = "Change Here!"
+def do_loop_run():
+    while True:
+        sleep(1)
+        print(message_loop)
+        print(message_loop)
+        print(message_loop)
+
+#Basic Program
+while auth:
+    check_run = input(colors.yellow + "This is loop program. Run this program?(y/N):" + colors.reset)
+    if check_run == "n" or check_run == "N" or check_run == "":
+        print("Cancel")
+        auth = False
+    elif check_run == "y" or check_run == "Y":
+        print("Enter 'Ctrl + C' to exit.")
+        do_loop_run()
+    else:
+        print("Retry please.")