Skip to content

Commit

Permalink
fixed numerous issues with the container and importing
Browse files Browse the repository at this point in the history
  • Loading branch information
shitwolfymakes committed Mar 31, 2022
1 parent ba8216e commit 7e8b4f9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
3 changes: 3 additions & 0 deletions arm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import arm.config
import arm.ripper
import arm.ui
8 changes: 4 additions & 4 deletions arm/ripper/main.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/env python3

import os
import sys

sys.path.append("/opt/arm")
# set the PATH to /arm/arm so we can handle imports properly
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../.."))

import argparse # noqa: E402
import os # noqa: E402
import logging # noqa: E402
import time # noqa: E402
import datetime # noqa: E402
Expand All @@ -14,10 +15,9 @@
import pyudev # noqa: E402
import getpass # noqa E402
import psutil # noqa E402
import arm.config.config as cfg
import arm.config.config as cfg # noqa E402

from arm.ripper import logger, utils, makemkv, handbrake, identify # noqa: E402

from arm.ripper.getkeys import grabkeys # noqa: E402
from arm.models.models import Job, Config # noqa: E402
from arm.ui import app, db # noqa E402
Expand Down
10 changes: 6 additions & 4 deletions arm/runui.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import os # noqa: F401
import os
import sys

# set the PATH to /arm/arm so we can handle imports properly
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))

import arm.config.config as cfg # noqa E402
from arm.ui import app # noqa E402
from arm.config.config import cfg # noqa E402
import arm.ui.routes # noqa E402

host = arm_config['WEBSERVER_IP']
host = cfg.arm_config['WEBSERVER_IP']
if host == 'x.x.x.x':
# autodetect host IP address
from netifaces import interfaces, ifaddresses, AF_INET
Expand All @@ -23,5 +25,5 @@
host = '127.0.0.1'

if __name__ == '__main__':
app.run(host=host, port=arm_config['WEBSERVER_PORT'], debug=True)
app.run(host=host, port=cfg.arm_config['WEBSERVER_PORT'], debug=True)
# app.run(debug=True)
3 changes: 2 additions & 1 deletion arm/ui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import sys # noqa: F401
import os # noqa: F401
import bcrypt # noqa: F401
import arm.config.config as cfg

from flask import Flask, logging, current_app # noqa: F401
from flask_sqlalchemy import SQLAlchemy
Expand All @@ -13,6 +12,8 @@

from flask_login import LoginManager

import arm.config.config as cfg

sqlitefile = 'sqlite:///' + cfg.arm_config['DBFILE']

app = Flask(__name__)
Expand Down
4 changes: 1 addition & 3 deletions arm/ui/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,7 @@ def settings():
This needs rewritten to be static
"""
x = ""
#arm_cfg_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../..", "arm.yaml")
comments = utils.generate_comments()
#arm_config = utils.get_settings(arm_cfg_file)

form = SettingsForm()
if form.validate_on_submit():
Expand Down Expand Up @@ -345,7 +343,7 @@ def settings():
flash("Setting saved successfully!", "success")
return redirect(url_for('settings'))
# If we get to here there was no post data
return render_template('settings.html', settings=cfg, form=form, raw=x, jsoncomments=comments)
return render_template('settings.html', settings=cfg.arm_config, form=form, raw=x, jsoncomments=comments)


@app.route('/ui_settings', methods=['GET', 'POST'])
Expand Down

0 comments on commit 7e8b4f9

Please sign in to comment.