Giter Club home page Giter Club logo

computerspende's People

Contributors

antonstech avatar destinyofyeet avatar dmuix avatar realwuffi avatar sonnix-de avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

computerspende's Issues

Detection of cd-rom breaks whole script

Major bug: script fails at detection of cd-rom

checkforcd = subprocess.check_output("sudo --.-.lshw -C disk",shell=True).decode()

The --.-. seems strange

Also it would be way better no just to have "Ja / Nein", but to have a bit more details like if it is able to write DVDs etc.
So if you would call "sudo lshw -json -C disk" and try to extract the node from "id" : "cdrom"
Then you could append all the "capabilities" like that: cd-r cd-rw dvd dvd-ram

This ist the output from my notebook:

  {
    "id" : "cdrom",
    "class" : "disk",
    "claimed" : true,
    "handle" : "SCSI:02:00:00:00",
    "description" : "DVD-RAM writer",
    "product" : "DVDRAM GT80N",
    "vendor" : "HL-DT-ST",
    "physid" : "0.0.0",
    "businfo" : "scsi@2:0.0.0",
    "logicalname" : ["/dev/cdrom", "/dev/cdrw", "/dev/dvd", "/dev/dvdrw", "/dev/sr0"],
    "dev" : "11:0",
    "version" : "FS05",
    "configuration" : {
      "ansiversion" : "5",
      "status" : "nodisc"
    },
    "capabilities" : {
      "removable" : "support is removable",
      "audio" : "Audio CD playback",
      "cd-r" : "CD-R burning",
      "cd-rw" : "CD-RW burning",
      "dvd" : "DVD playback",
      "dvd-r" : "DVD-R burning",
      "dvd-ram" : "DVD-RAM burning"
    }
  }

KeyError: 'chassis'

[ WARN:0] global /tmp/pip-req-build-ms668fyv/opencv/modules/videoio/src/cap_v4l.cpp (893) open VIDEOIO(V4L2:/dev/video0): can't open camera by index
Traceback (most recent call last):
File "main.py", line 8, in
import IssueBuilder as IssueBuilder
File "/home/daniel/Documents/computerspende/IssueBuilder.py", line 59, in
print(build())
File "/home/daniel/Documents/computerspende/IssueBuilder.py", line 50, in build
"name": category(lshwJson)
File "/home/daniel/Documents/computerspende/IssueBuilder.py", line 17, in category
if lshwJson["configuration"]["chassis"] == 'notebook' or lshwJson["configuration"]["chassis"] == 'laptop':
KeyError: 'chassis'

Images

NICHT LÖSCHEN wird für die Anleitung benötigt!

TokenErstellung1

TokenErstellung2

TokenErstellung3

TokenErstellung4

TokenErstellung5

TokenLöschen

Code in cdrom could be better formatted

Maybe someone has a good solution to write this code here nicer than it is at the moment?

def cdrom():
    lshw = json.loads(str(subprocess.check_output("sudo lshw -json -C disk", shell=True).decode()))
    for disk in lshw:
        if "cdrom" in disk['id']:
            capabilities = {disk['capabilities'][k] for k in disk['capabilities'].keys() - {'removable'}} # removes key 'removable' from dictionary
            capabilities = sorted(capabilities) # sorts capabilities alphabetically
            capabilities = str(capabilities).replace("[","").replace("]", "").replace("'", "") # creates an output that makes sense without square braclets [] and single quotation mark '
            if "DVD" in capabilities:
                return "DVD-Laufwerk: " + capabilities
            elif "CD" in capabilities:
                return "CD-Laufwerk: " + capabilities
        else:
            continue
    return "Laufwerk: Kein Laufwerk verbaut"

Mantis-Instanz: Standort-Feld updaten damit keine Leerzeichen

im aktuellen Mantis sind beim Feld Standort teilweise Leerzeichen vorne und hinten dran
(... | Wolfgang | Ribisl | ....

Diese müssen weg und die custom_field_string ein update gemacht werden um Leerzeichen vorne und hinten weg zu nehmen
ansonsten wird es etwas blöd, den Standort in seinem eigenen Script zu hinterlegen

"Free text" should be on top of description

I think we should set the text, that you can enter during the creation of the issue to the top of the issue

example:

this is the text I entered in the python script

Auflösung: ....
Grafikkarte: .....
USB3: ja

Hostname also in /etc/hosts

Currently we only set /etc/hostname

In /etc/hosts there is also the previous hostname set.
I don't know what the other one is used for, but we should check I guess.

AttributeError: module 'readhw' has no attribute 'getInformationAboutCurrentComputer'

Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/daniel/Documents/computerspende/venv/lib/python3.8/site-packages/consolemenu/console_menu.py", line 169, in _wrap_start
self._main_loop()
File "/home/daniel/Documents/computerspende/venv/lib/python3.8/site-packages/consolemenu/console_menu.py", line 226, in _main_loop
self.process_user_input()
File "/home/daniel/Documents/computerspende/venv/lib/python3.8/site-packages/consolemenu/console_menu.py", line 311, in process_user_input
self.select()
File "/home/daniel/Documents/computerspende/venv/lib/python3.8/site-packages/consolemenu/console_menu.py", line 351, in select
self.selected_item.action()
File "/home/daniel/Documents/computerspende/venv/lib/python3.8/site-packages/consolemenu/items/function_item.py", line 35, in action
self.return_value = self.function(*self.args, **self.kwargs)
File "main.py", line 13, in showHardware
print(hw.getInformationAboutCurrentComputer())
AttributeError: module 'readhw' has no attribute 'getInformationAboutCurrentComputer'

Prettier Output for Sonstiges

@ the Moment it looks a little ugly as the first line is completely omitted. Would be nicer to use the first line, too!

enhancement cdrom

Also it would be way better no just to have "Ja / Nein", but to have a bit more details like if it is able to write DVDs etc.
So if you would call "sudo lshw -json -C disk" and try to extract the node from "id" : "cdrom"
Then you could append all the "capabilities" like that: cd-r cd-rw dvd dvd-ram

This ist the output from my notebook:

  {
    "id" : "cdrom",
    "class" : "disk",
    "claimed" : true,
    "handle" : "SCSI:02:00:00:00",
    "description" : "DVD-RAM writer",
    "product" : "DVDRAM GT80N",
    "vendor" : "HL-DT-ST",
    "physid" : "0.0.0",
    "businfo" : "scsi@2:0.0.0",
    "logicalname" : ["/dev/cdrom", "/dev/cdrw", "/dev/dvd", "/dev/dvdrw", "/dev/sr0"],
    "dev" : "11:0",
    "version" : "FS05",
    "configuration" : {
      "ansiversion" : "5",
      "status" : "nodisc"
    },
    "capabilities" : {
      "removable" : "support is removable",
      "audio" : "Audio CD playback",
      "cd-r" : "CD-R burning",
      "cd-rw" : "CD-RW burning",
      "dvd" : "DVD playback",
      "dvd-r" : "DVD-R burning",
      "dvd-ram" : "DVD-RAM burning"
    }
  }

FileNotFoundError: [Errno 2] No such file or directory: 'config.json'

Should check if config.json is available if not should create it.
Traceback (most recent call last): File "main.py", line 7, in <module> import issues as issues File "/home/daniel/Documents/computerspende/issues.py", line 8, in <module> content = open("config.json").read() FileNotFoundError: [Errno 2] No such file or directory: 'config.json'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.