Skip to content

Commit

Permalink
Merge pull request #324 from davidhozic/develop
Browse files Browse the repository at this point in the history
Release 2.8 Prep
  • Loading branch information
davidhozic authored Jun 3, 2023
2 parents 65c971e + c081c69 commit 2c467ac
Show file tree
Hide file tree
Showing 75 changed files with 2,137 additions and 1,824 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ docs/common/reference
daf_web_data
test.py

venv/*
.venv/*
venv*
.venv*
14 changes: 6 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
=========================================================
Discord Advertisement Framework (Shiller)
Discord Advertisement Framework
=========================================================
The Discord advertisement framework is a Python based **shilling application** that allows automatic advertising (and much more) on Discord.
The Discord advertisement framework is a Python based automatic application that allows **easy automatic advertisement** (and much more) on Discord.


.. image:: ./docs/images/daf-gui-front.png

.. image:: ./docs/images/daf-gui-front-edit-msg.png

---------------
Help
---------------
Need help? Contact me in my `Discord server <https://discord.gg/DEnvahb2Sw>`_.


----------------
Guide / Usage
----------------
Instructions can be found `here <https://daf.davidhozic.com/en/stable/guide/GUI/quickstart.html>`_.

---------------
Help
---------------
Need help? Contact me in my `Discord server <https://discord.gg/DEnvahb2Sw>`_.

----------------------
Key features
Expand Down
4 changes: 2 additions & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ SOURCEDIR ?= source
BUILDDIR ?= build
USE_LANGUAGE ?= en

export LANGUAGE=$(USE_LANGUAGE)

_BUILD_DIR = $(BUILDDIR)/$(SOURCEDIR)


# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Expand All @@ -31,8 +33,6 @@ pdf: latex
cp $(CURDIR)/$(_BUILD_DIR)/latex/*.pdf $(CURDIR)/$(_BUILD_DIR)/pdf/


export LANGUAGE=$(USE_LANGUAGE)

%: Makefile
python3 ./setup.py
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(_BUILD_DIR)" $(SPHINXOPTS) $(O)
Binary file modified docs/images/daf-gui-front-edit-msg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/daf-gui-front.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
cp_to = dest["to"]
if re.search(r"\.[A-z]+$", cp_to) is None: # The path does not have extension -> assume a dir
_src = [x for x in glob.glob(cp_from, recursive=True) if os.path.isfile(x)]
_dest = [os.path.join(cp_to, m.lstrip("./").lstrip("../")) for m in _src]
_dest = [os.path.join(cp_to, os.path.basename(m)) for m in _src]
else:
_src = [cp_from]
_dest = [cp_to]
Expand All @@ -59,6 +59,7 @@

# Run scripts
if CLEAN:
os.chdir(cwd)
continue

scripts = setup_file_data["scripts"]
Expand All @@ -68,4 +69,3 @@

# Change cwd back to original
os.chdir(cwd)

30 changes: 29 additions & 1 deletion docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,34 @@ Glossary
Releases
----------------------

v2.8
=================

- Remote control though HTTP access:

- The core can be started on a remote server and then connected to and controlled by the graphical interface.
- The GUI now has a dropdown menu where users can select between a local connection client and a remote connection client.
Local connection client won't use the HTTP API, but will start DAF locally and interact with it directly.

- GUI:

- Method execution
- Executing method status window.
- When editing objects, the Y size will now be set to default size every time the frame changes.
- When executing async blocking functions, a progress bar window will be shown to indicate something is happening.

- Logging:

- :class:`daf.logging.LoggerJSON` will create a new file once the current one reaches 100 kilobytes.
- Improved performance of :class:`daf.logging.LoggerJSON`.
- Loggers will now trace their output path, so users can find the output logs more easily.

- State preservation

- When using the state preservation (introduced in :ref:`v2.7`), accounts that fail to login will, from now on,
not be removed from list to prevent data loss.



v2.7
================
Expand Down Expand Up @@ -102,7 +130,7 @@ v2.6.0
- Graphical User Interface - **GUI** for controlling the framework,
defining the schema (with backup and restore) and script generation!

.. image:: ./DEP/images/daf-gui-front.png
.. image:: ./DEP/daf-gui-front.png
:align: center
:scale: 40%

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

# ----------- HTML ----------- #
html_title = project
html_logo = "./DEP/images/logo.png"
html_logo = "./DEP/logo.png"
html_favicon = html_logo
html_theme = 'furo'
html_static_path = ['_static']
Expand Down
6 changes: 3 additions & 3 deletions docs/source/guide/GUI/filegen.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Schema backup
.. seealso::
:download:`Download example schema backup (schema.json) <./images/schema.json>`

To save a schema after it has been defined, we can click on the *Load/Save/Generate* button, located in the top left
To save a schema after it has been defined, we can click on the *Schema* button, located in the top left
corner of the *Schema definition* tab and then click the **Save schema** option.

We will be asked for a file location of the schema backup, where the GUI will save backup our schema.
Expand All @@ -37,7 +37,7 @@ We will be asked for a file location of the schema backup, where the GUI will sa

Schema restore
---------------
In case we want to restore a backed-up schema, we can click on the *Load/Save/Generate* button, located in the top left
In case we want to restore a backed-up schema, we can click on the *Schema* button, located in the top left
corner of the *Schema definition* tab and then click the **Load schema** option.

We will be asked for a file location of the schema backup, from which the GUI will load our schema.
Expand All @@ -56,7 +56,7 @@ a computer capable of displaying image.

Luckily DAF-GUI allows use to create a (Python) shilling script in the event that we want to run DAF on a server 24/7.

To generate a shilling script , we can click on the *Load/Save/Generate* button, located in the top left
To generate a shilling script , we can click on the *Schema* button, located in the top left
corner of the *Schema definition* tab and then click the **Generate script** option.
This will open up a file dialog asking us where to save the shilling script.
After we save the location our shilling script will be generated and we
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion docs/source/guide/GUI/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ This section contains the guide to using the Discord Advertisement Framework ins
schema
live_view
filegen
analytics
analytics
remote
3 changes: 2 additions & 1 deletion docs/source/guide/GUI/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ After successful installation, DAF can be run in graphical mode by executing the
This will open up (after a few seconds) a graphical display you can use to control the framework.

.. image:: ./DEP/images/daf-gui-front.png
.. image:: ./DEP/daf-gui-front.png
:scale: 50%
:align: center

Expand All @@ -23,6 +23,7 @@ GUI structure
The GUI consists of:

- START and STOP buttons starting and stopping DAF's core,
- Connection type selection (see :ref:`Remote control (GUI)`)
- Optional modules tab - Where you can install optional functionallity
- Schema definition tab - Where you can define accounts, guilds, messages & type of logging:

Expand Down
38 changes: 38 additions & 0 deletions docs/source/guide/GUI/remote.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
======================
Remote control (GUI)
======================
.. versionadded:: 2.8


.. seealso::

This section describes how to set up the GUI to connect to a server.
To find information about setting up the actual server see :ref:`Remote control (core)`.


DAF can run either locally or it can connect to a remote server that is running the
DAF core. Users can choose between these two options by changing the connection client as
shown in picture:

.. image:: ./images/connection-select.png
:width: 1000px

Using ``LocalConnectionCLIENT`` will start DAF locally and anything the users do will be done locally.
Using :class:`~daf_gui.connector.RemoteConnectionCLIENT` will connect to a remote server and anything the users do including adding / removing
accounts, retrieving logs, etc. will be done through a HTTP API which can also be HTTPS (recommended) if desired.


If the *Edit* button is clicked (in the top right corner) and :class:`~daf_gui.connector.RemoteConnectionCLIENT`
is selected, a new window will be opened, which allows customization of connection parameters.


.. image:: ./images/edit-remoteconnectionclient.png

.. autoclass:: daf_gui.connector.RemoteConnectionCLIENT

.. seealso::

When :ref:`generating the DAF core script <Shilling script generation>`,
remote access will also be configured if the :class:`~daf_gui.connector.RemoteConnectionCLIENT` is selected.

Clicking on *Edit* when ``LocalConnectionCLIENT`` is selected will show an error.
2 changes: 1 addition & 1 deletion docs/source/guide/GUI/schema.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The tab allows us to define:
2. Logging & tracing


.. image:: ./DEP/images/daf-gui-front.png
.. image:: ./DEP/daf-gui-front.png
:width: 20cm
:align: center

Expand Down
4 changes: 2 additions & 2 deletions docs/source/guide/core/autogen.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ It can be passed to the framework exactly the same way as |GUILD|
otherwise you will be spammed with warnings and only one guild will be shilled.


.. literalinclude:: ./DEP/Examples/Automatic Generation/autoguild.py
.. literalinclude:: ./DEP/autoguild.py


Automatic channel generation
==============================
For a auto-managed channel list use |AUTOCHANNEL| instances.
It can be passed to xMESSAGE objects into the ``channels`` parameters instead of a list.

.. literalinclude:: ./DEP/Examples/Automatic Generation/autochannel.py
.. literalinclude:: ./DEP/autochannel.py
:caption: AutoCHANNEL example
1 change: 1 addition & 0 deletions docs/source/guide/core/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ words, running it directly by Python and providing all the required information
quickstart
messages
logging
remote
modification
autogen
web
12 changes: 6 additions & 6 deletions docs/source/guide/core/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ All logs will contain keys:
+ :py:meth:`daf.message.DirectMESSAGE.generate_log_context`

.. seealso::
:download:`Example structure <./DEP/Examples/Logging/JSON files/History/2023/04/28/David's py dungeon.json>`
:download:`Example structure <./DEP/David's py dungeon.json>`

.. only:: html

JSON code example
-----------------
.. literalinclude:: ./DEP/Examples/Logging/JSON files/main_rickroll.py
.. literalinclude:: ./DEP/main_rickroll.py
:language: python
:caption: Code to produce JSON logs

Expand Down Expand Up @@ -144,14 +144,14 @@ The structure contains the following attributes:
Attributes marked with ``(json)`` are the same as in :ref:`JSON Logging (file)`

.. seealso::
:download:`Structure example <./DEP/Examples/Logging/CSV files/History/2023/04/28/David's py dungeon.csv>`
:download:`Structure example <./DEP/David's py dungeon.csv>`


.. only:: html

CSV code example
-----------------
.. literalinclude:: ./DEP/Examples/Logging/CSV files/main_rickroll.py
.. literalinclude:: ./DEP/main_rickroll.py
:language: python
:caption: Code to produce JSON logs

Expand Down Expand Up @@ -183,7 +183,7 @@ For daf to use SQL logging, you need to pass the :func:`~daf.core.run` function

.. only:: html

.. literalinclude:: ./DEP/Examples/Logging/SQL Logging/rolls.py
.. literalinclude:: ./DEP/rolls.py
:language: python


Expand All @@ -203,7 +203,7 @@ Features

ER diagram
--------------------------------
.. image:: ./DEP/images/sql_er.drawio.svg
.. image:: ./DEP/sql_er.drawio.svg
:width: 1440


Expand Down
6 changes: 3 additions & 3 deletions docs/source/guide/core/messages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ To add these messages to the guild, set the |GUILD| / |USER|'s ``messages`` para

.. only:: html

.. literalinclude:: ./DEP/Examples/Message Types/TextMESSAGE/main_send_multiple.py
.. literalinclude:: ./DEP/main_send_multiple.py
:language: Python
:caption: **TextMESSAGE example - normal text (string)**

.. literalinclude:: ./DEP/Examples/Message Types/DirectMESSAGE/main_send_multiple.py
.. literalinclude:: ./DEP/main_send_multiple.py
:language: Python
:caption: **DirectMESSAGE example - normal text (string)**

Expand All @@ -57,5 +57,5 @@ You can either stream a fixed audio file or a youtube video, both thru :class:`d

.. only:: html

.. literalinclude:: ./DEP/Examples/Message Types/VoiceMESSAGE/main_stream_audio.py
.. literalinclude:: ./DEP/main_stream_audio.py
:caption: **VoiceMESSAGE example - audio file**
6 changes: 3 additions & 3 deletions docs/source/guide/core/modification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The function can be used to add the following object types:
.. only:: html

.. literalinclude:: ./DEP/Examples/Dynamic Modification/main_add_object.py
.. literalinclude:: ./DEP/main_add_object.py
:language: python


Expand All @@ -80,7 +80,7 @@ Objects can be removed with the :func:`daf.core.remove_object`.

.. only:: html

.. literalinclude:: ./DEP/Examples/Dynamic Modification/main_remove_object.py
.. literalinclude:: ./DEP/main_remove_object.py
:language: python


Expand Down Expand Up @@ -129,7 +129,7 @@ For a full list of objects that support ``.update`` search ".update" in the sear

.. only:: html

.. literalinclude:: ./DEP/Examples/Dynamic Modification/main_update.py
.. literalinclude:: ./DEP/main_update.py
:language: python


16 changes: 16 additions & 0 deletions docs/source/guide/core/remote.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
======================
Remote control (core)
======================

.. versionadded:: 2.8

While DAF can run completely standalone locally, it also allows to be run as a server that will accept connections from
a graphical interface (:ref:`Remote control (GUI)`).

The remote module spins up a HTTP server which can also be given a certificate and a private key allowing HTTPS connections.

To set up the core as a remote server, pass the :func:`~daf.core.run` function with the ``remote_client`` parameter.
It accepts an object of type :class:`daf.remote.RemoteAccessCLIENT`.

After the script is ran, DAF will listen and accept connections based on the configured options. While the server is running,
DAF can be used the same way as if there was no server at all.
2 changes: 1 addition & 1 deletion docs/source/guide/core/web.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,5 @@ Web feature example
=====================
The following shows an example of both previously described features.

.. literalinclude:: ./DEP/Examples/Web/main_web.py
.. literalinclude:: ./DEP/main_web.py
:language: python
Loading

0 comments on commit 2c467ac

Please sign in to comment.