Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: GentooForum.de. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

20.04.2012, 19:30

Griffith lässt nicht mehr starten

Hallo Leute

Bei lässt sich Griffith nicht mehr starten. Hat wohl ein Problem mit der Pythonversion 3. Ich nutze media-video/griffith 0.13.

Quellcode

1
2
3
4
5
griffith 
  File "/usr/bin/griffith", line 58
    print "no gtk_osxapplication support."
                                         ^
SyntaxError: invalid syntax

Was meint ihr zu dem Problem?

Laut Homepage http://griffith.cc/index.php?option=com_…id=22&Itemid=39 gehts aber mit der neuen Version.

lg
boospy
Gentoo Can Do!

Wiki auf: http://deepdoc.at

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »boospy« (21.04.2012, 10:06)


2

21.04.2012, 08:03

Das ist kein Fehler von griffith selbst, sondern eine Python Inkompatibilität.

In Python 2 gab es ein

Quellcode

1
> print "bla"
in Python 3 muss das eine Funktion sein. Also:

Quellcode

1
> print("bla")


Starte dein griffith mit python 2. Dann wird es gehen.
http://www.dyle.org
IM-Account (Jabber!) sind auf meiner HP ...
There is no place like /home

http://www.gentooforum.de
http://www.gentoofreunde.org

<div>how to annoy a web developer?</span>

3

21.04.2012, 10:01

Aja, sowas in der Richtung dachte ich mir schon. Hab ein wenig gegoogelt. Nachdem ich den Header der ausführbaren Datei geändert habe, funktioniert es. Kann man mit jedem Programm machen. Find ich angenehm. Also:
nano /usr/bin/griffith

Quellcode

1
2
 Von   #!/usr/bin/env python
in      #!/usr/bin/env python2.7


lg
boospy
Gentoo Can Do!

Wiki auf: http://deepdoc.at

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »boospy« (21.04.2012, 10:06)


4

23.04.2012, 13:58

Danke für die Info ...

Hatte woanders auch ein Phytion-Versions-Problem und kam nicht drauf, es in die #! zu setzen ...
Meine Rechtschreibfehler sind gewollt und unterliegen dem Copyright des Verfassers, es sei denn, sie sind explizit unter die GPL gestellt .....

Außerdem sind sie ein Ausdruck der Persönlichkeit des Schreibers!

5

07.07.2014, 20:09

Wegen einer inkompatiblität mit dev-python/sqlalchemy 0.9 lässt sich das Programm nicht mehr starten. Abhilfe schafft das script validators.py. Und nun das Original ersetzen

Quellcode

1
cp validators.py /usr/lib64/griffith/db/validators.py

Ich habe es sicherheitshaber auch nochmal angehängt.

lg
boospy

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# -*- coding: UTF-8 -*-
# vim: fdm=marker
__revision__ = '$Id$'

# Copyright © 2011
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA

# You may use and distribute this software under the terms of the
# GNU General Public License, version 2 or later

import logging

from sqlalchemy.orm.interfaces import AttributeExtension
try:
    # sql alchemy 0.8 (and above)
    from sqlalchemy.ext.instrumentation import InstrumentationManager
except:
    # sql alchemy 0.7
    from sqlalchemy.orm.interfaces import InstrumentationManager
from sqlalchemy.orm import ColumnProperty
from sqlalchemy.types import String

use_pre_07 = False
try:
    from sqlalchemy import event
except:
    use_pre_07 = True

log = logging.getLogger('Griffith')

class InstallValidatorListeners(InstrumentationManager):
    def post_configure_attribute(self, class_, key, inst):
        if use_pre_07:
            self.post_configure_attribute_pre_07(class_, key, inst)
        else:
            self.post_configure_attribute_07(class_, key, inst)
        
    def post_configure_attribute_07(self, class_, key, inst):
        """Add validators for any attributes that can be validated."""
        # SQLAlchemy >= 0.7 (using events)
        prop = inst.prop
        # Only interested in simple columns, not relations
        if isinstance(prop, ColumnProperty) and len(prop.columns) == 1:
            col = prop.columns[0]
            # if we have string column with a length, install a length validator
            if isinstance(col.type, String) and col.type.length:
                event.listen(inst, 'set', LengthValidator(col.name, col.type.length).set, retval=True)

    def post_configure_attribute_pre_07(self, class_, key, inst):
        """Add validators for any attributes that can be validated."""
        # SQLAlchemy < 0.7 (using extensions)
        prop = inst.prop
        # Only interested in simple columns, not relations
        if isinstance(prop, ColumnProperty) and len(prop.columns) == 1:
            col = prop.columns[0]
            # if we have string column with a length, install a length validator
            if isinstance(col.type, String) and col.type.length:
                inst.impl.extensions.insert(0, LengthValidator(col.name, col.type.length))


class ValidationError(Exception):
    pass


class LengthValidator(AttributeExtension):
    def __init__(self, name, max_length):
        self.name = name
        self.max_length = max_length

    def set(self, state, value, oldvalue, initiator):
        if value and len(value) > self.max_length:
            # can be changed so that an exception is raised which can be shown in UI
            # but at the moment an exception is silently lost, only written to console
            #raise ValidationError("Length %d exceeds allowed %d for %s" %
            #                    (len(value), self.max_length, self.name))
            log.warning("Length %d exceeds allowed %d for %s; truncating value" %
                                (len(value), self.max_length, self.name))
            return value[0:self.max_length]
        return value
Gentoo Can Do!

Wiki auf: http://deepdoc.at