From 3e531fc68f67b32b26e74b76993fb88aab5ad934 Mon Sep 17 00:00:00 2001 From: Richard Abrich Date: Wed, 12 Apr 2023 18:05:21 -0400 Subject: [PATCH] add alembic version --- puterbot/LICENSE => LICENSE | 0 README.md | 2 +- ...40_add_recording_inputevent_screenshot_.py | 84 +++++++++++++++++++ puterbot/README.md | 1 + puterbot/requirements.txt => requirements.txt | 0 puterbot/setup.py => setup.py | 0 6 files changed, 86 insertions(+), 1 deletion(-) rename puterbot/LICENSE => LICENSE (100%) create mode 100644 alembic/versions/b206c80f7640_add_recording_inputevent_screenshot_.py rename puterbot/requirements.txt => requirements.txt (100%) rename puterbot/setup.py => setup.py (100%) diff --git a/puterbot/LICENSE b/LICENSE similarity index 100% rename from puterbot/LICENSE rename to LICENSE diff --git a/README.md b/README.md index 14e2c6997..242356d7f 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ We hope that these stubs and suggestions will help you get started with your imp ## Submitting an Issue -Please submit any issues to https://github.com/MLDSAI/PAT/issues with the +Please submit any issues to https://github.com/MLDSAI/puterbot/issues with the following information: - Problem description (include any relevant console output and/or screenshots) diff --git a/alembic/versions/b206c80f7640_add_recording_inputevent_screenshot_.py b/alembic/versions/b206c80f7640_add_recording_inputevent_screenshot_.py new file mode 100644 index 000000000..3f95d63ca --- /dev/null +++ b/alembic/versions/b206c80f7640_add_recording_inputevent_screenshot_.py @@ -0,0 +1,84 @@ +"""add Recording; InputEvent; ScreenShot; WindowEvent + +Revision ID: b206c80f7640 +Revises: +Create Date: 2023-04-12 18:01:55.287166 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'b206c80f7640' +down_revision = None +branch_labels = None +depends_on = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('recording', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('timestamp', sa.Integer(), nullable=True), + sa.Column('monitor_width', sa.Integer(), nullable=True), + sa.Column('monitor_height', sa.Integer(), nullable=True), + sa.Column('double_click_interval_seconds', sa.Numeric(asdecimal=False), nullable=True), + sa.Column('double_click_distance_pixels', sa.Numeric(asdecimal=False), nullable=True), + sa.Column('platform', sa.String(), nullable=True), + sa.PrimaryKeyConstraint('id', name=op.f('pk_recording')) + ) + op.create_table('screenshot', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('recording_timestamp', sa.Integer(), nullable=True), + sa.Column('timestamp', sa.Integer(), nullable=True), + sa.Column('png_data', sa.LargeBinary(), nullable=True), + sa.PrimaryKeyConstraint('id', name=op.f('pk_screenshot')) + ) + op.create_table('window_event', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('recording_timestamp', sa.Integer(), nullable=True), + sa.Column('timestamp', sa.Integer(), nullable=True), + sa.Column('title', sa.String(), nullable=True), + sa.Column('left', sa.Integer(), nullable=True), + sa.Column('top', sa.Integer(), nullable=True), + sa.Column('width', sa.Integer(), nullable=True), + sa.Column('height', sa.Integer(), nullable=True), + sa.PrimaryKeyConstraint('id', name=op.f('pk_window_event')) + ) + op.create_table('input_event', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('name', sa.String(), nullable=True), + sa.Column('timestamp', sa.Integer(), nullable=True), + sa.Column('recording_timestamp', sa.Integer(), nullable=True), + sa.Column('screenshot_timestamp', sa.Integer(), nullable=True), + sa.Column('window_event_timestamp', sa.Integer(), nullable=True), + sa.Column('mouse_x', sa.Numeric(asdecimal=False), nullable=True), + sa.Column('mouse_y', sa.Numeric(asdecimal=False), nullable=True), + sa.Column('mouse_dx', sa.Numeric(asdecimal=False), nullable=True), + sa.Column('mouse_dy', sa.Numeric(asdecimal=False), nullable=True), + sa.Column('mouse_button_name', sa.String(), nullable=True), + sa.Column('mouse_pressed', sa.Boolean(), nullable=True), + sa.Column('key_name', sa.String(), nullable=True), + sa.Column('key_char', sa.String(), nullable=True), + sa.Column('key_vk', sa.String(), nullable=True), + sa.Column('canonical_key_name', sa.String(), nullable=True), + sa.Column('canonical_key_char', sa.String(), nullable=True), + sa.Column('canonical_key_vk', sa.String(), nullable=True), + sa.Column('parent_id', sa.Integer(), nullable=True), + sa.ForeignKeyConstraint(['parent_id'], ['input_event.id'], name=op.f('fk_input_event_parent_id_input_event')), + sa.ForeignKeyConstraint(['recording_timestamp'], ['recording.timestamp'], name=op.f('fk_input_event_recording_timestamp_recording')), + sa.ForeignKeyConstraint(['screenshot_timestamp'], ['screenshot.timestamp'], name=op.f('fk_input_event_screenshot_timestamp_screenshot')), + sa.ForeignKeyConstraint(['window_event_timestamp'], ['window_event.timestamp'], name=op.f('fk_input_event_window_event_timestamp_window_event')), + sa.PrimaryKeyConstraint('id', name=op.f('pk_input_event')) + ) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_table('input_event') + op.drop_table('window_event') + op.drop_table('screenshot') + op.drop_table('recording') + # ### end Alembic commands ### diff --git a/puterbot/README.md b/puterbot/README.md index 95419633a..a8db3874c 100644 --- a/puterbot/README.md +++ b/puterbot/README.md @@ -1,6 +1,7 @@ ## Setup ``` +git clone https://github.com/MLDSAI/puterbot.git cd puterbot python3.10 -m venv .venv source .venv/bin/activate diff --git a/puterbot/requirements.txt b/requirements.txt similarity index 100% rename from puterbot/requirements.txt rename to requirements.txt diff --git a/puterbot/setup.py b/setup.py similarity index 100% rename from puterbot/setup.py rename to setup.py