[solved] Emacs depend on Python ?

Hi, guys. When I install :
$ yaourt -S emacs
  I see python appears in the dependencies. I think Emacs is written in C and Elisp, nothing about python. Anyone knows why ?
  When I install emacs-nox, I got very few dependencies. Why there are so big difference between emacs and emacs-nox ? I think emacs only have a X interface than emacs-nox. Compared with Vim,  X interface is too huge.
  Thanks.
Last edited by jameschyn (2011-12-01 14:11:39)

Check the respective PKGBUILDs and dependencies.
No need to use an AUR helper: both emacs and emacs-nox are in the repos.
=== Edit ===
I think I've got it: https://bugs.archlinux.org/task/26195 - sane pulls libieee1284 and libieee1284 needs python2.
emacs-nox uses ncurses and not gtk3 (emacs needs gconf, gconf needs gtk3) so it's much leaner.
Last edited by karol (2011-10-20 02:51:08)

Similar Messages

  • [SOLVED] Emacs dependent on Ubuntu font family

    Installed emacs, and when I tried to run it, this what it said:
    Font `Ubuntu Mono 13' is not defined
    And it wouldn't start. I had to install ttf-ubuntu-font-family to make it run. File ~/.emacs was empty, and nothing resembling ubuntu (except for a few comments) could not be found under /usr/share/emacs.
    Did anybody else have this issue? Maybe emacs package should have ubuntu font dependency?
    Last edited by kotnik (2011-11-22 10:34:26)

    I have the same problem, emacs can't work  on X11 but works fine without X, that's not related with these  ttf-ubuntu-font-family cause it's installed, i have no .emacs file and .emacs.d/ folder is empty.
    The problem is related with my user profile cause it works on an other profile on the same system.

  • Cannot resolve "python", a dependency of "python-distutils-extra"

    Attempting to perform a full system upgrade on 32 bit archbang 2012.05, and when I `pacman -Syu`: this occurs
    Anyone know how to deal with this issue?
    $ sudo pacmatic -Syu
    Recent ML chatter:
    :: Synchronizing package databases...
    core is up to date
    extra is up to date
    community is up to date
    :: Starting full system upgrade...
    :: Replace libusb with core/libusbx? [Y/n] y
    :: Replace procps with core/procps-ng? [Y/n] y
    :: Replace udev with core/systemd-tools? [Y/n] y
    resolving dependencies...
    warning: cannot resolve "python", a dependency of "python-distutils-extra"
    :: The following package cannot be upgraded due to unresolvable dependencies:
    python-distutils-extra
    Do you want to skip the above package for this upgrade? [y/N] y
    warning: dependency cycle detected:
    warning: util-linux will be installed before its systemd-tools dependency
    looking for inter-conflicts...
    Targets (71): acl-2.2.51-2 arandr-0.1.6-1 attr-2.4.46-2 automake-1.12.1-1
    bash-4.2.029-1 binutils-2.22-7 bzip2-1.0.6-4 coreutils-8.17-1
    cryptsetup-1.4.2-2 curl-7.26.0-1 db-5.3.21-1 deadbeef-0.5.4-2
    device-mapper-2.02.95-6 dnsutils-9.9.1-1 e2fsprogs-1.42.3-1
    filesystem-2012.2-5 gcc-4.7.0-6 gcc-libs-4.7.0-6
    glib2-2.32.3-1 gmp-5.0.5-1 gpm-1.20.6-8 hwids-20120512-1
    initscripts-2012.05.1-3 isl-0.09-2 kmod-8-2 krb5-1.10.1-3
    libcap-2.22-3 libevent-2.0.19-1 libldap-2.4.31-2 libnl-3.2.9-1
    libpipeline-1.2.1-1 libssh2-1.4.2-1 libusb-1.0.9-1 [removal]
    libusb-compat-0.1.4-1 libusbx-1.0.11-2 linux-3.3.7-1
    linux-firmware-20120227-2 lvm2-2.02.95-6 lxappearance-0.5.2-1
    lxinput-0.3.2-2 lxterminal-0.1.11-2 man-pages-3.41-1
    mdadm-3.2.5-2 menu-cache-0.3.3-1 mkinitcpio-0.9.1-1
    mkinitcpio-busybox-1.20.1-1 mpfr-3.1.0.p10-1 oblogout-0.2-11
    openbox-3.5.0-7 openssl-1.0.1.c-1 pam-1.1.5-3 pciutils-3.1.9-2
    perl-5.16.0-2 pinentry-0.8.1-4 procps-3.2.8-5 [removal]
    procps-ng-3.3.3-1 python2-distutils-extra-2.32-1
    run-parts-4.3.1-1 shotwell-0.12.3-1 sudo-1.8.5.p2-1
    sysfsutils-2.1.0-8 syslog-ng-3.3.5-1 systemd-tools-184-2
    udev-182-1 [removal] usbutils-005-2 util-linux-2.21.2-1
    virtualbox-archlinux-additions-4.1.16-1
    virtualbox-archlinux-modules-4.1.16-1 volumeicon-0.4.6-4
    xfsprogs-3.1.8-2 zlib-1.2.7-1
    Total Installed Size: 390.46 MiB
    Net Upgrade Size: 3.42 MiB
    Proceed with installation? [Y/n] y
    (68/68) checking package integrity [----------------------] 100%
    (68/68) loading package files [----------------------] 100%
    (68/68) checking for file conflicts [----------------------] 100%
    error: failed to commit transaction (conflicting files)
    python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/__init__.py exists in filesystem
    python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/__init__.pyc exists in filesystem
    python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/auto.py exists in filesystem
    python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/auto.pyc exists in filesystem
    python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/__init__.py exists in filesystem
    python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/__init__.pyc exists in filesystem
    python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/build_extra.py exists in filesystem
    python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/build_extra.pyc exists in filesystem
    python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/build_help.py exists in filesystem
    python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/build_help.pyc exists in filesystem
    python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/build_i18n.py exists in filesystem
    python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/build_i18n.pyc exists in filesystem
    python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/build_icons.py exists in filesystem
    python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/build_icons.pyc exists in filesystem
    python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/clean_i18n.py exists in filesystem
    python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/clean_i18n.pyc exists in filesystem
    python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/pylint.py exists in filesystem
    python2-distutils-extra: /usr/lib/python2.7/site-packages/DistUtilsExtra/command/pylint.pyc exists in filesystem
    Errors occurred, no packages were upgraded.
    No pacnew files to update.

    I do not thing archbang is officially  archlinux distributions (you are on an archlinux forum). This error does not appear on the current archlinux distribution. My guess is that here is a confusion between python / python2 / python3. Just run pacman -Si to know (or the equivalent of pacman for archbang).
    I would suggest you to use the official archlinux instead of this fork, archlinux has much more support and users and I do not quite understand what archbang has to offer: Their homepage said that it is archlinux combined with openbox, but you can just do
    pacman -S openbox
    on arch; it does not seems to justify a fork (but please correct me if I am wrong).
    Last edited by olive (2012-06-17 22:00:23)

  • [SOLVED] tv_grab_nl_py works with python 2.6.5, fails on 3.1.2

    Hi All,
    I have updated my mediacenter. Now tv_grab_nl_py does not work anymore:
    [cedric@tv ~]$ tv_grab_nl_py --output ~/listings.xml --fast
    File "/usr/bin/tv_grab_nl_py", line 341
    print 'tv_grab_nl_py: A grabber that grabs tvguide data from tvgids.nl\n'
    ^
    SyntaxError: invalid syntax
    [cedric@tv ~]$
    the version of python on the mediacenter (running arch linux):
    [cedric@tv ~]$ python
    Python 3.1.2 (r312:79147, Oct 4 2010, 12:35:40)
    [GCC 4.5.1] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    I have copied the file to my laptop, there it looks like it's working:
    ./tv_grab_nl_py --output ~/listings.xml --fast
    Config file /home/cedric/.xmltv/tv_grab_nl_py.conf not found.
    Re-run me with the --configure flag.
    cedric@laptop:~$
    the version of python on my laptop (running arch linux):
    cedric@laptop:~$ python
    Python 2.6.5 (r265:79063, Apr 1 2010, 05:22:20)
    [GCC 4.4.3 20100316 (prerelease)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    the script I'm trying to run:
    [cedric@tv ~]$ cat tv_grab_nl_py
    #!/usr/bin/env python
    # $LastChangedDate: 2009-11-14 10:06:41 +0100 (Sat, 14 Nov 2009) $
    # $Rev: 104 $
    # $Author: pauldebruin $
    SYNOPSIS
    tv_grab_nl_py is a python script that trawls tvgids.nl for TV
    programming information and outputs it in XMLTV-formatted output (see
    http://membled.com/work/apps/xmltv). Users of MythTV
    (http://www.mythtv.org) will appreciate the output generated by this
    grabber, because it fills the category fields, i.e. colors in the EPG,
    and has logos for most channels automagically available. Check the
    website below for screenshots. The newest version of this script can be
    found here:
    http://code.google.com/p/tvgrabnlpy/
    USAGE
    Check the web site above and/or run script with --help and start from there
    HISTORY
    tv_grab_nl_py used to be called tv_grab_nl_pdb, first released on
    2003/07/09. The name change was necessary because more and more people
    are actively contributing to this script and I always disliked using my
    initials (I was just too lazy to change it). At the same time I switched
    from using CVS to SVN and as a result the version numbering scheme has
    changed. The lastest official release of tv_grab_nl_pdb is 0.48. The
    first official release of tv_grab_nl_py is 6.
    QUESTIONS
    Questions (and patches) are welcome at: paul at pwdebruin dot net.
    IMPORTANT NOTES
    If you were using tv_grab_nl from the XMLTV bundle then enable the
    compat flag or use the --compat command-line option. Otherwise, the
    xmltvid's are wrong and you will not see any new data in MythTV.
    CONTRIBUTORS
    Main author: Paul de Bruin (paul at pwdebruin dot net)
    Michel van der Laan made available his extensive collection of
    high-quality logos that is used by this script.
    Michael Heus has taken the effort to further enhance this script so that
    it now also includes:
    - Credit info: directors, actors, presenters and writers
    - removal of programs that are actually just groupings/broadcasters
    (e.g. "KETNET", "Wild Friday", "Z@pp")
    - Star-rating for programs tipped by tvgids.nl
    - Black&White, Stereo and URL info
    - Better detection of Movies
    - and much, much more...
    Several other people have provided feedback and patches (these are the
    people I could find in my email archive, if you are missing from this
    list let me know):
    Huub Bouma, Roy van der Kuil, Remco Rotteveel, Mark Wormgoor, Dennis van
    Onselen, Hugo van der Kooij, Han Holl, Ian Mcdonald, Udo van den Heuvel.
    # Modules we need
    import re, urllib2, getopt, sys
    import time, random
    import htmlentitydefs, os, os.path, pickle
    from string import replace, split, strip
    from threading import Thread
    from xml.sax import saxutils
    # Extra check for the datetime module
    try:
    import datetime
    except:
    sys.stderr.write('This script needs the datetime module that was introduced in Python version 2.3.\n')
    sys.stderr.write('You are running:\n')
    sys.stderr.write('%s\n' % sys.version)
    sys.exit(1)
    # XXX: fix to prevent crashes in Snow Leopard [Robert Klep]
    if sys.platform == 'darwin' and sys.version_info[:3] == (2, 6, 1):
    try:
    urllib2.urlopen('http://localhost.localdomain')
    except:
    pass
    # do extra debug stuff
    debug = 1
    try:
    import redirect
    except:
    debug = 0
    pass
    # globals
    # compile only one time
    r_entity = re.compile(r'&(#x[0-9A-Fa-f]+|#[0-9]+|[A-Za-z]+);')
    tvgids = 'http://www.tvgids.nl/'
    uitgebreid_zoeken = tvgids + 'zoeken/'
    # how many seconds to wait before we timeout on a
    # url fetch, 10 seconds seems reasonable
    global_timeout = 10
    # Wait a random number of seconds between each page fetch.
    # We want to be nice and not hammer tvgids.nl (these are the
    # friendly people that provide our data...).
    # Also, it appears tvgids.nl throttles its output.
    # So there, there is not point in lowering these numbers, if you
    # are in a hurry, use the (default) fast mode.
    nice_time = [1, 2]
    # Maximum length in minutes of gaps/overlaps between programs to correct
    max_overlap = 10
    # Strategy to use for correcting overlapping prgramming:
    # 'average' = use average of stop and start of next program
    # 'stop' = keep stop time of current program and adjust start time of next program accordingly
    # 'start' = keep start time of next program and adjust stop of current program accordingly
    # 'none' = do not use any strategy and see what happens
    overlap_strategy = 'average'
    # Experimental strategy for clumping overlapping programming, all programs that overlap more
    # than max_overlap minutes, but less than the length of the shortest program are clumped
    # together. Highly experimental and disabled for now.
    do_clump = False
    # Create a category translation dictionary
    # Look in mythtv/themes/blue/ui.xml for all category names
    # The keys are the categories used by tvgids.nl (lowercase please)
    cattrans = { 'amusement' : 'Talk',
    'animatie' : 'Animated',
    'comedy' : 'Comedy',
    'documentaire' : 'Documentary',
    'educatief' : 'Educational',
    'erotiek' : 'Adult',
    'film' : 'Film',
    'muziek' : 'Art/Music',
    'informatief' : 'Educational',
    'jeugd' : 'Children',
    'kunst/cultuur' : 'Arts/Culture',
    'misdaad' : 'Crime/Mystery',
    'muziek' : 'Music',
    'natuur' : 'Science/Nature',
    'nieuws/actualiteiten' : 'News',
    'overige' : 'Unknown',
    'religieus' : 'Religion',
    'serie/soap' : 'Drama',
    'sport' : 'Sports',
    'theater' : 'Arts/Culture',
    'wetenschap' : 'Science/Nature'}
    # Create a role translation dictionary for the xmltv credits part
    # The keys are the roles used by tvgids.nl (lowercase please)
    roletrans = {'regie' : 'director',
    'acteurs' : 'actor',
    'presentatie' : 'presenter',
    'scenario' : 'writer'}
    # We have two sources of logos, the first provides the nice ones, but is not
    # complete. We use the tvgids logos to fill the missing bits.
    logo_provider = [ 'http://visualisation.tudelft.nl/~paul/logos/gif/64x64/',
    'http://static.tvgids.nl/gfx/zenders/' ]
    logo_names = {
    1 : [0, 'ned1'],
    2 : [0, 'ned2'],
    3 : [0, 'ned3'],
    4 : [0, 'rtl4'],
    5 : [0, 'een'],
    6 : [0, 'canvas_color'],
    7 : [0, 'bbc1'],
    8 : [0, 'bbc2'],
    9 : [0,'ard'],
    10 : [0,'zdf'],
    11 : [1, 'rtl'],
    12 : [0, 'wdr'],
    13 : [1, 'ndr'],
    14 : [1, 'srsudwest'],
    15 : [1, 'rtbf1'],
    16 : [1, 'rtbf2'],
    17 : [0, 'tv5'],
    18 : [0, 'ngc'],
    19 : [1, 'eurosport'],
    20 : [1, 'tcm'],
    21 : [1, 'cartoonnetwork'],
    24 : [0, 'canal+red'],
    25 : [0, 'mtv-color'],
    26 : [0, 'cnn'],
    27 : [0, 'rai'],
    28 : [1, 'sat1'],
    29 : [0, 'discover-spacey'],
    31 : [0, 'rtl5'],
    32 : [1, 'trt'],
    34 : [0, 'veronica'],
    35 : [0, 'tmf'],
    36 : [0, 'sbs6'],
    37 : [0, 'net5'],
    38 : [1, 'arte'],
    39 : [0, 'canal+blue'],
    40 : [0, 'at5'],
    46 : [0, 'rtl7'],
    49 : [1, 'vtm'],
    50 : [1, '3sat'],
    58 : [1, 'pro7'],
    59 : [1, 'kanaal2'],
    60 : [1, 'vt4'],
    65 : [0, 'animal-planet'],
    73 : [1, 'mezzo'],
    86 : [0, 'bbc-world'],
    87 : [1, 'tve'],
    89 : [1, 'nick'],
    90 : [1, 'bvn'],
    91 : [0, 'comedy_central'],
    92 : [0, 'rtl8'],
    99 : [1, 'sport1_1'],
    100 : [0, 'rtvu'],
    101 : [0, 'tvwest'],
    102 : [0, 'tvrijnmond'],
    103 : [1, 'tvnoordholland'],
    104 : [1, 'bbcprime'],
    105 : [1, 'spiceplatinum'],
    107 : [0, 'canal+yellow'],
    108 : [0, 'tvnoord'],
    109 : [0, 'omropfryslan'],
    114 : [0, 'omroepbrabant']}
    # A selection of user agents we will impersonate, in an attempt to be less
    # conspicuous to the tvgids.nl police.
    user_agents = [ 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',
    'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9',
    'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)',
    'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7',
    'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)',
    'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.9) Gecko/20071105 Firefox/2.0.0.9',
    'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9',
    'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8) Gecko/20071022 Ubuntu/7.10 (gutsy) Firefox/2.0.0.8'
    # Work in progress, the idea is to cache program categories and
    # descriptions to eliminate a lot of page fetches from tvgids.nl
    # for programs that do not have interesting/changing descriptions
    class ProgramCache:
    A cache to hold program name and category info.
    TVgids stores the detail for each program on a separate URL with an
    (apparently unique) ID. This cache stores the fetched info with the ID.
    New fetches will use the cached info instead of doing an (expensive)
    page fetch.
    def __init__(self, filename=None):
    Create a new ProgramCache object, optionally from file
    # where we store our info
    self.filename = filename
    if filename == None:
    self.pdict = {}
    else:
    if os.path.isfile(filename):
    self.load(filename)
    else:
    self.pdict = {}
    def load(self, filename):
    Loads a pickled cache dict from file
    try:
    self.pdict = pickle.load(open(filename,'r'))
    except:
    sys.stderr.write('Error loading cache file: %s (possibly corrupt)' % filename)
    sys.exit(2)
    def dump(self, filename):
    Dumps a pickled cache, and makes sure it is valid
    if os.access(filename, os.F_OK):
    try:
    os.remove(filename)
    except:
    sys.stderr.write('Cannot remove %s, check permissions' % filename)
    pickle.dump(self.pdict, open(filename+'.tmp', 'w'))
    os.rename(filename+'.tmp', filename)
    def query(self, program_id):
    Updates/gets/whatever.
    try:
    return self.pdict[program_id]
    except:
    return None
    def add(self, program):
    Adds a program
    self.pdict[program['ID']] = program
    def clear(self):
    Clears the cache (i.e. empties it)
    self.pdict = {}
    def clean(self):
    Removes all cached programming before today.
    Also removes erroneously cached programming.
    now = time.localtime()
    dnow = datetime.datetime(now[0],now[1],now[2])
    for key in self.pdict.keys():
    try:
    if self.pdict[key]['stop-time'] < dnow or self.pdict[key]['name'].lower() == 'onbekend':
    del self.pdict[key]
    except:
    pass
    def usage():
    print 'tv_grab_nl_py: A grabber that grabs tvguide data from tvgids.nl\n'
    print 'and stores it in XMLTV-combatible format.\n'
    print 'Usage:'
    print '--help, -h = print this info'
    print '--configure = create configfile (overwrites existing file)'
    print '--config-file = name of the configuration file (default = ~/.xmltv/tv_grab_py.conf'
    print '--capabilities = xmltv required option'
    print '--desc-length = maximum allowed length of programme descriptions in bytes.'
    print '--description = prints a short description of the grabber'
    print '--output = file where to put the output'
    print '--days = # number of days to grab'
    print '--preferredmethod = returns the preferred method to be called'
    print '--fast = do not grab descriptions of programming'
    print '--slow = grab descriptions of programming'
    print '--quiet = suppress all output'
    print '--compat = append tvgids.nl to the xmltv id (use this if you were using tv_grab_nl)'
    print '--logos 0/1 = insert urls to channel icons (mythfilldatabase will then use these)'
    print '--nocattrans = do not translate the grabbed genres into MythTV-genres'
    print '--cache = cache descriptions and use the file to store'
    print '--clean_cache = clean the cache file before fetching'
    print '--clear_cache = empties the cache file before fetching data'
    print '--slowdays = grab slowdays initial days and the rest in fast mode'
    print '--max_overlap = maximum length of overlap between programming to correct [minutes]'
    print '--overlap_strategy = what strategy to use to correct overlaps (check top of source code)'
    def filter_line_identity(m, defs=htmlentitydefs.entitydefs):
    # callback: translate one entity to its ISO Latin value
    k = m.group(1)
    if k.startswith("#") and k[1:] in xrange(256):
    return chr(int(k[1:]))
    try:
    return defs[k]
    except KeyError:
    return m.group(0) # use as is
    def filter_line(s):
    Removes unwanted stuff in strings (adapted from tv_grab_be)
    # do the latin1 stuff
    s = r_entity.sub(filter_line_identity, s)
    s = replace(s,'&nbsp;',' ')
    # Ik vermoed dat de volgende drie regels overbodig zijn, maar ze doen
    # niet veel kwaad -- Han Holl
    s = replace(s,'\r',' ')
    x = re.compile('(<.*?>)') # Udo
    s = x.sub('', s) #Udo
    s = replace(s, '~Q', "'")
    s = replace(s, '~R', "'")
    # Hmm, not sure if I understand this. Without it, mythfilldatabase barfs
    # on program names like "Steinbrecher &..."
    # We most create valid XML -- Han Holl
    s = saxutils.escape(s)
    return s
    def calc_timezone(t):
    Takes a time from tvgids.nl and formats it with all the required
    timezone conversions.
    in: '20050429075000'
    out:'20050429075000 (CET|CEST)'
    Until I have figured out how to correctly do timezoning in python this method
    will bork if you are not in a zone that has the same DST rules as 'Europe/Amsterdam'.
    year = int(t[0:4])
    month = int(t[4:6])
    day = int(t[6:8])
    hour = int(t[8:10])
    minute = int(t[10:12])
    #td = {'CET': '+0100', 'CEST': '+0200'}
    #td = {'CET': '+0100', 'CEST': '+0200', 'W. Europe Standard Time' : '+0100', 'West-Europa (standaardtijd)' : '+0100'}
    td = {0 : '+0100', 1 : '+0200'}
    pt = time.mktime((year,month,day,hour,minute,0,0,0,-1))
    timezone=''
    try:
    #timezone = time.tzname[(time.localtime(pt))[-1]]
    timezone = (time.localtime(pt))[-1]
    except:
    sys.stderr.write('Cannot convert time to timezone')
    return t+' %s' % td[timezone]
    def format_timezone(td):
    Given a datetime object, returns a string in XMLTV format
    tstr = td.strftime('%Y%m%d%H%M00')
    return calc_timezone(tstr)
    def get_page_internal(url, quiet=0):
    Retrieves the url and returns a string with the contents.
    Optionally, returns None if processing takes longer than
    the specified number of timeout seconds.
    txtdata = None
    txtheaders = {'Keep-Alive' : '300',
    'User-Agent' : user_agents[random.randint(0, len(user_agents)-1)] }
    try:
    #fp = urllib2.urlopen(url)
    rurl = urllib2.Request(url, txtdata, txtheaders)
    fp = urllib2.urlopen(rurl)
    lines = fp.readlines()
    page = "".join(lines)
    return page
    except:
    if not quiet:
    sys.stderr.write('Cannot open url: %s\n' % url)
    return None
    class FetchURL(Thread):
    A simple thread to fetch a url with a timeout
    def __init__ (self, url, quiet=0):
    Thread.__init__(self)
    self.quiet = quiet
    self.url = url
    self.result = None
    def run(self):
    self.result = get_page_internal(self.url, self.quiet)
    def get_page(url, quiet=0):
    Wrapper around get_page_internal to catch the
    timeout exception
    try:
    fu = FetchURL(url, quiet)
    fu.start()
    fu.join(global_timeout)
    return fu.result
    except:
    if not quiet:
    sys.stderr.write('get_page timed out on (>%s s): %s\n' % (global_timeout, url))
    return None
    def get_channels(file, quiet=0):
    Get a list of all available channels and store these
    in a file.
    # store channels in a dict
    channels = {}
    # tvgids stores several instances of channels, we want to
    # find all the possibile channels
    channel_get = re.compile('<optgroup label=.*?>(.*?)</optgroup>', re.DOTALL)
    # this is how we will find a (number, channel) instance
    channel_re = re.compile('<option value="([0-9]+)" >(.*?)</option>', re.DOTALL)
    # this is where we will try to find our channel list
    total = get_page(uitgebreid_zoeken, quiet)
    if total == None:
    return
    # get a list of match objects of all the <select blah station>
    stations = channel_get.finditer(total)
    # and create a dict of number, channel_name pairs
    # we do this this way because several instances of the
    # channel list are stored in the url and not all of the
    # instances have all the channels, this way we get them all.
    for station in stations:
    m = channel_re.finditer(station.group(0))
    for p in m:
    try:
    a = int(p.group(1))
    b = filter_line(p.group(2))
    channels[a] = b
    except:
    sys.stderr.write('Oops, [%s,%s] does not look like a valid channel, skipping it...\n' % (p.group(1),p.group(2)))
    # sort on channel number (arbitrary but who cares)
    keys = channels.keys()
    keys.sort()
    # and create a file with the channels
    f = open(file,'w')
    for k in keys:
    f.write("%s %s\n" % (k, channels[k]))
    f.close()
    def get_channel_all_days(channel, days, quiet=0):
    Get all available days of programming for channel number
    The output is a list of programming in order where each row
    contains a dictionary with program information.
    now = datetime.datetime.now()
    programs = []
    # Tvgids shows programs per channel per day, so we loop over the number of days
    # we are required to grab
    for offset in range(0, days):
    channel_url = 'http://www.tvgids.nl/zoeken/?d=%i&z=%s' % (offset, channel)
    # For historic purposes, the old style url that gave us a full week in advance:
    # channel_url = 'http://www.tvgids.nl/zoeken/?trefwoord=Titel+of+trefwoord&interval=0&timeslot='+\
    # '&station=%s&periode=%i&genre=&order=0' % (channel,days-1)
    # Sniff, we miss you...
    if offset > 0:
    time.sleep(random.randint(nice_time[0], nice_time[1]))
    # get the raw programming for the day
    total = get_page(channel_url, quiet)
    if total == None:
    return programs
    # Setup a number of regexps
    # checktitle will match the title row in H2 tags of the daily overview page, e.g.
    # <h2>zondag 19 oktober 2008</h2>
    checktitle = re.compile('<h2>(.*?)</h2>',re.DOTALL)
    # getrow will locate each row with program details
    getrow = re.compile('<a href="/programma/(.*?)</a>',re.DOTALL)
    # parserow matches the required program info, with groups:
    # 1 = program ID
    # 2 = broadcast times
    # 3 = program name
    parserow = re.compile('(.*?)/.*<span class="time">(.*?)</span>.*<span class="title">(.*?)</span>', re.DOTALL)
    # normal begin and end times
    times = re.compile('([0-9]+:[0-9]+) - ([0-9]+:[0-9]+)?')
    # Get the day of month listed on the page as well as the expected date we are grabbing and compare these.
    # If these do not match, we skip parsing the programs on the page and issue a warning.
    #dayno = int(checkday.search(total).group(1))
    title = checktitle.search(total)
    if title:
    title = title.group(1)
    dayno = title.split()[1]
    else:
    sys.stderr.write('\nOops, there was a problem with page %s. Skipping it...\n' % (channel_url))
    continue
    expected = now + datetime.timedelta(days=offset)
    if (not dayno.isdigit() or int(dayno) != expected.day):
    sys.stderr.write('\nOops, did not expect page %s to list programs for "%s", skipping it...\n' % (channel_url,title))
    continue
    # and find relevant programming info
    allrows = getrow.finditer(total)
    for r in allrows:
    detail = parserow.search(r.group(1))
    if detail != None:
    # default times
    start_time = None
    stop_time = None
    # parse for begin and end times
    t = times.search(detail.group(2))
    if t != None:
    start_time = t.group(1)
    stop_time = t.group(2)
    program_url = 'http://www.tvgids.nl/programma/' + detail.group(1) + '/'
    program_name = detail.group(3)
    # store time, name and detail url in a dictionary
    tdict = {}
    tdict['start'] = start_time
    tdict['stop'] = stop_time
    tdict['name'] = program_name
    if tdict['name'] == '':
    tdict['name'] = 'onbekend'
    tdict['url'] = program_url
    tdict['ID'] = detail.group(1)
    tdict['offset'] = offset
    #Add star rating if tipped by tvgids.nl
    tdict['star-rating'] = '';
    if r.group(1).find('Tip') != -1:
    tdict['star-rating'] = '4/5'
    # and append the program to the list of programs
    programs.append(tdict)
    # done
    return programs
    def make_daytime(time_string, offset=0, cutoff='00:00', stoptime=False):
    Given a string '11:35' and an offset from today,
    return a datetime object. The cuttoff specifies the point where the
    new day starts.
    Examples:
    In [2]:make_daytime('11:34',0)
    Out[2]:datetime.datetime(2006, 8, 3, 11, 34)
    In [3]:make_daytime('11:34',1)
    Out[3]:datetime.datetime(2006, 8, 4, 11, 34)
    In [7]:make_daytime('11:34',0,'12:00')
    Out[7]:datetime.datetime(2006, 8, 4, 11, 34)
    In [4]:make_daytime('11:34',0,'11:34',False)
    Out[4]:datetime.datetime(2006, 8, 3, 11, 34)
    In [5]:make_daytime('11:34',0,'11:34',True)
    Out[5]:datetime.datetime(2006, 8, 4, 11, 34)
    h,m = [int(x) for x in time_string.split(':')];
    hm = int(time_string.replace(':',''))
    chm = int(cutoff.replace(':',''))
    # check for the cutoff, if the time is before the cutoff then
    # add a day
    extra_day = 0
    if (hm < chm) or (stoptime==True and hm == chm):
    extra_day = 1
    # and create a datetime object, DST is handled at a later point
    pt = time.localtime()
    dt = datetime.datetime(pt[0],pt[1],pt[2],h,m)
    dt = dt + datetime.timedelta(offset+extra_day)
    return dt
    def correct_times(programs, quiet=0):
    Parse a list of programs as generated by get_channel_all_days() and
    convert begin and end times to xmltv compatible times in datetime objects.
    if programs == []:
    return programs
    # the start time of programming for this day, times *before* this time are
    # assumed to be on the next day
    day_start_time = '06:00'
    # initialise using the start time of the first program on this day
    if programs[0]['start'] != None:
    day_start_time = programs[0]['start']
    for program in programs:
    if program['start'] == program['stop']:
    program['stop'] = None
    # convert the times
    if program['start'] != None:
    program['start-time'] = make_daytime(program['start'], program['offset'], day_start_time)
    else:
    program['start-time'] = None
    if program['stop'] != None:
    program['stop-time'] = make_daytime(program['stop'], program['offset'], day_start_time, stoptime=True)
    # extra correction, needed because the stop time of a program may be on the next day, after the
    # day cutoff. For example:
    # 06:00 - 23:40 Long Program
    # 23:40 - 00:10 Lala
    # 00:10 - 08:00 Wawa
    # This puts the end date of Wawa on the current, instead of the next day. There is no way to detect
    # this with a single cutoff in make_daytime. Therefore, check if there is a day difference between
    # start and stop dates and correct if necessary.
    if program['start-time'] != None:
    # make two dates
    start = program['start-time']
    stop = program['stop-time']
    single_day = datetime.timedelta(1)
    startdate = datetime.datetime(start.year,start.month,start.day)
    stopdate = datetime.datetime(stop.year,stop.month,stop.day)
    if startdate - stopdate == single_day:
    program['stop-time'] = program['stop-time'] + single_day
    else:
    program['stop-time'] = None
    def parse_programs(programs, offset=0, quiet=0):
    Parse a list of programs as generated by get_channel_all_days() and
    convert begin and end times to xmltv compatible times.
    # good programs
    good_programs = []
    # calculate absolute start and stop times
    correct_times(programs, quiet)
    # next, correct for missing end time and copy over all good programming to the
    # good_programs list
    for i in range(len(programs)):
    # Try to correct missing end time by taking start time from next program on schedule
    if (programs[i]['stop-time'] == None and i < len(programs)-1):
    if not quiet:
    sys.stderr.write('Oops, "%s" has no end time. Trying to fix...\n' % programs[i]['name'])
    programs[i]['stop-time'] = programs[i+1]['start-time']
    # The common case: start and end times are present and are not
    # equal to each other (yes, this can happen)
    if programs[i]['start-time'] != None and \
    programs[i]['stop-time'] != None and \
    programs[i]['start-time'] != programs[i]['stop-time']:
    good_programs.append(programs[i])
    # Han Holl: try to exclude programs that stop before they begin
    for i in range(len(good_programs)-1,-1,-1):
    if good_programs[i]['stop-time'] <= good_programs[i]['start-time']:
    if not quiet:
    sys.stderr.write('Deleting invalid stop/start time: %s\n' % good_programs[i]['name'])
    del good_programs[i]
    # Try to exclude programs that only identify a group or broadcaster and have overlapping start/end times with
    # the actual programs
    for i in range(len(good_programs)-2,-1,-1):
    if good_programs[i]['start-time'] <= good_programs[i+1]['start-time'] and \
    good_programs[i]['stop-time'] >= good_programs[i+1]['stop-time']:
    if not quiet:
    sys.stderr.write('Deleting grouping/broadcaster: %s\n' % good_programs[i]['name'])
    del good_programs[i]
    for i in range(len(good_programs)-1):
    # PdB: Fix tvgids start-before-end x minute interval overlap. An overlap (positive or
    # negative) is halved and each half is assigned to the adjacent programmes. The maximum
    # overlap length between programming is set by the global variable 'max_overlap' and is
    # default 10 minutes. Examples:
    # Positive overlap (= overlap in programming):
    # 10:55 - 12:00 Lala
    # 11:55 - 12:20 Wawa
    # is transformed in:
    # 10:55 - 11.57 Lala
    # 11:57 - 12:20 Wawa
    # Negative overlap (= gap in programming):
    # 10:55 - 11:50 Lala
    # 12:00 - 12:20 Wawa
    # is transformed in:
    # 10:55 - 11.55 Lala
    # 11:55 - 12:20 Wawa
    stop = good_programs[i]['stop-time']
    start = good_programs[i+1]['start-time']
    dt = stop-start
    avg = start + dt / 2
    overlap = 24*60*60*dt.days + dt.seconds
    # check for the size of the overlap
    if 0 < abs(overlap) <= max_overlap*60:
    if not quiet:
    if overlap > 0:
    sys.stderr.write('"%s" and "%s" overlap %s minutes. Adjusting times.\n' % \
    (good_programs[i]['name'],good_programs[i+1]['name'],overlap / 60))
    else:
    sys.stderr.write('"%s" and "%s" have gap of %s minutes. Adjusting times.\n' % \
    (good_programs[i]['name'],good_programs[i+1]['name'],abs(overlap) / 60))
    # stop-time of previous program wins
    if overlap_strategy == 'stop':
    good_programs[i+1]['start-time'] = good_programs[i]['stop-time']
    # start-time of next program wins
    elif overlap_strategy == 'start':
    good_programs[i]['stop-time'] = good_programs[i+1]['start-time']
    # average the difference
    elif overlap_strategy == 'average':
    good_programs[i]['stop-time'] = avg
    good_programs[i+1]['start-time'] = avg
    # leave as is
    else:
    pass
    # Experimental strategy to make sure programming does not disappear. All programs that overlap more
    # than the maximum overlap length, but less than the shortest length of the two programs are
    # clumped.
    if do_clump:
    for i in range(len(good_programs)-1):
    stop = good_programs[i]['stop-time']
    start = good_programs[i+1]['start-time']
    dt = stop-start
    overlap = 24*60*60*dt.days + dt.seconds
    length0 = good_programs[i]['stop-time'] - good_programs[i]['start-time']
    length1 = good_programs[i+1]['stop-time'] - good_programs[i+1]['start-time']
    l0 = length0.days*24*60*60 + length0.seconds
    l1 = length1.days*24*60*60 + length0.seconds
    if abs(overlap) >= max_overlap*60 <= min(l0,l1)*60 and \
    not good_programs[i].has_key('clumpidx') and \
    not good_programs[i+1].has_key('clumpidx'):
    good_programs[i]['clumpidx'] = '0/2'
    good_programs[i+1]['clumpidx'] = '1/2'
    good_programs[i]['stop-time'] = good_programs[i+1]['stop-time']
    good_programs[i+1]['start-time'] = good_programs[i]['start-time']
    # done, nothing to see here, please move on
    return good_programs
    def get_descriptions(programs, program_cache=None, nocattrans=0, quiet=0, slowdays=0):
    Given a list of programs, from get_channel, retrieve program information
    # This regexp tries to find details such as Genre, Acteurs, Jaar van Premiere etc.
    detail = re.compile('<li>.*?<strong>(.*?):</strong>.*?<br />(.*?)</li>', re.DOTALL)
    # These regexps find the description area, the program type and descriptive text
    description = re.compile('<div class="description">.*?<div class="text"(.*?)<div class="clearer"></div>',re.DOTALL)
    descrtype = re.compile('<div class="type">(.*?)</div>',re.DOTALL)
    descrline = re.compile('<p>(.*?)</p>',re.DOTALL)
    # randomize detail requests
    nprograms = len(programs)
    fetch_order = range(0,nprograms)
    random.shuffle(fetch_order)
    counter = 0
    for i in fetch_order:
    counter += 1
    if programs[i]['offset'] >= slowdays:
    continue
    if not quiet:
    sys.stderr.write('\n(%3.0f%%) %s: %s ' % (100*float(counter)/float(nprograms), i, programs[i]['name']))
    # check the cache for this program's ID
    cached_program = program_cache.query(programs[i]['ID'])
    if (cached_program != None):
    if not quiet:
    sys.stderr.write(' [cached]')
    # copy the cached information, except the start/end times, rating and clumping,
    # these may have changed.
    tstart = programs[i]['start-time']
    tstop = programs[i]['stop-time']
    rating = programs[i]['star-rating']
    try:
    clump = programs[i]['clumpidx']
    except:
    clump = False
    programs[i] = cached_program
    programs[i]['start-time'] = tstart
    programs[i]['stop-time'] = tstop
    programs[i]['star-rating'] = rating
    if clump:
    programs[i]['clumpidx'] = clump
    continue
    else:
    # be nice to tvgids.nl
    time.sleep(random.randint(nice_time[0], nice_time[1]))
    # get the details page, and get all the detail nodes
    descriptions = ()
    details = ()
    try:
    if not quiet:
    sys.stderr.write(' [normal fetch]')
    total = get_page(programs[i]['url'])
    details = detail.finditer(total)
    descrspan = description.search(total);
    descriptions = descrline.finditer(descrspan.group(1))
    except:
    # if we cannot find the description page,
    # go to next in the loop
    if not quiet:
    sys.stderr.write(' [fetch failed or timed out]')
    continue
    # define containers
    programs[i]['credits'] = {}
    programs[i]['video'] = {}
    # now parse the details
    line_nr = 1;
    # First, we try to find the program type in the description section.
    # Note that this is not the same as the generic genres (these are searched later on), but a more descriptive one like "Culinair programma"
    # If present, we store this as first part of the regular description:
    programs[i]['detail1'] = descrtype.search(descrspan.group(1)).group(1).capitalize()
    if programs[i]['detail1'] != '':
    line_nr = line_nr + 1
    # Secondly, we add one or more lines of the program description that are present.
    for descript in descriptions:
    d_str = 'detail' + str(line_nr)
    programs[i][d_str] = descript.group(1)
    # Remove sponsored link from description if present.
    sponsor_pos = programs[i][d_str].rfind('<i>Gesponsorde link:</i>')
    if sponsor_pos > 0:
    programs[i][d_str] = programs[i][d_str][0:sponsor_pos]
    programs[i][d_str] = filter_line(programs[i][d_str]).strip()
    line_nr = line_nr + 1
    # Finally, we check out all program details. These are generically denoted as:
    # <li><strong>(TYPE):</strong><br />(CONTENT)</li>
    # Some examples:
    # <li><strong>Genre:</strong><br />16 oktober 2008</li>
    # <li><strong>Genre:</strong><br />Amusement</li>
    for d in details:
    type = d.group(1).strip().lower()
    content_asis = d.group(2).strip()
    content = filter_line(content_asis).strip()
    if content == '':
    continue
    elif type == 'genre':
    # Fix detection of movies based on description as tvgids.nl sometimes
    # categorises a movie as e.g. "Komedie", "Misdaadkomedie", "Detectivefilm".
    genre = content;
    if (programs[i]['detail1'].lower().find('film') != -1 \
    or programs[i]['detail1'].lower().find('komedie') != -1)\
    and programs[i]['detail1'].lower().find('tekenfilm') == -1 \
    and programs[i]['detail1'].lower().find('animatiekomedie') == -1 \
    and programs[i]['detail1'].lower().find('filmpje') == -1:
    genre = 'film'
    if nocattrans:
    programs[i]['genre'] = genre.title()
    else:
    try:
    programs[i]['genre'] = cattrans[genre.lower()]
    except:
    programs[i]['genre'] = ''
    # Parse persons and their roles for credit info
    elif roletrans.has_key(type):
    programs[i]['credits'][roletrans[type]] = []
    persons = content_asis.split(',');
    for name in persons:
    if name.find(':') != -1:
    name = name.split(':')[1]
    if name.find('-') != -1:
    name = name.split('-')[0]
    if name.find('e.a') != -1:
    name = name.split('e.a')[0]
    programs[i]['credits'][roletrans[type]].append(filter_line(name.strip()))
    elif type == 'bijzonderheden':
    if content.find('Breedbeeld') != -1:
    programs[i]['video']['breedbeeld'] = 1
    if content.find('Zwart') != -1:
    programs[i]['video']['blackwhite'] = 1
    if content.find('Teletekst') != -1:
    programs[i]['teletekst'] = 1
    if content.find('Stereo') != -1:
    programs[i]['stereo'] = 1
    elif type == 'url':
    programs[i]['infourl'] = content
    else:
    # In unmatched cases, we still add the parsed type and content to the program details.
    # Some of these will lead to xmltv output during the xmlefy_programs step
    programs[i][type] = content
    # do not cache programming that is unknown at the time
    # of fetching.
    if programs[i]['name'].lower() != 'onbekend':
    program_cache.add(programs[i])
    if not quiet:
    sys.stderr.write('\ndone...\n\n')
    # done
    def title_split(program):
    Some channels have the annoying habit of adding the subtitle to the title of a program.
    This function attempts to fix this, by splitting the name at a ': '.
    if (program.has_key('titel aflevering') and program['titel aflevering'] != '') \
    or (program.has_key('genre') and program['genre'].lower() in ['movies','film']):
    return
    colonpos = program['name'].rfind(': ')
    if colonpos > 0:
    program['titel aflevering'] = program['name'][colonpos+1:len(program['name'])].strip()
    program['name'] = program['name'][0:colonpos].strip()
    def xmlefy_programs(programs, channel, desc_len, compat=0, nocattrans=0):
    Given a list of programming (from get_channels())
    returns a string with the xml equivalent
    output = []
    for program in programs:
    clumpidx = ''
    try:
    if program.has_key('clumpidx'):
    clumpidx = 'clumpidx="'+program['clumpidx']+'"'
    except:
    print program
    output.append(' <programme start="%s" stop="%s" channel="%s%s" %s> \n' % \
    (format_timezone(program['start-time']), format_timezone(program['stop-time']),\
    channel, compat and '.tvgids.nl' or '', clumpidx))
    output.append(' <title lang="nl">%s</title>\n' % filter_line(program['name']))
    if program.has_key('titel aflevering') and program['titel aflevering'] != '':
    output.append(' <sub-title lang="nl">%s</sub-title>\n' % filter_line(program['titel aflevering']))
    desc = []
    for detail_row in ['detail1','detail2','detail3']:
    if program.has_key(detail_row) and not re.search('[Gg]een detailgegevens be(?:kend|schikbaar)', program[detail_row]):
    desc.append('%s ' % program[detail_row])
    if desc != []:
    # join and remove newlines from descriptions
    desc_line = "".join(desc).strip()
    desc_line.replace('\n', ' ')
    if len(desc_line) > desc_len:
    spacepos = desc_line[0:desc_len-3].rfind(' ')
    desc_line = desc_line[0:spacepos] + '...'
    output.append(' <desc lang="nl">%s</desc>\n' % desc_line)
    # Process credits section if present.
    # This will generate director/actor/presenter info.
    if program.has_key('credits') and program['credits'] != {}:
    output.append(' <credits>\n')
    for role in program['credits']:
    for name in program['credits'][role]:
    if name != '':
    output.append(' <%s>%s</%s>\n' % (role, name, role))
    output.append(' </credits>\n')
    if program.has_key('jaar van premiere') and program['jaar van premiere'] != '':
    output.append(' <date>%s</date>\n' % program['jaar van premiere'])
    if program.has_key('genre') and program['genre'] != '':
    output.append(' <category')
    if nocattrans:
    output.append(' lang="nl"')
    output.append ('>%s</category>\n' % program['genre'])
    if program.has_key('infourl') and program['infourl'] != '':
    output.append(' <url>%s</url>\n' % program['infourl'])
    if program.has_key('aflevering') and program['aflevering'] != '':
    output.append(' <episode-num system="onscreen">%s</episode-num>\n' % filter_line(program['aflevering']))
    # Process video section if present
    if program.has_key('video') and program['video'] != {}:
    output.append(' <video>\n');
    if program['video'].has_key('breedbeeld'):
    output.append(' <aspect>16:9</aspect>\n')
    if program['video'].has_key('blackwhite'):
    output.append(' <colour>no</colour>\n')
    output.append(' </video>\n')
    if program.has_key('stereo'):
    output.append(' <audio><stereo>stereo</stereo></audio>\n')
    if program.has_key('teletekst'):
    output.append(' <subtitles type="teletext" />\n')
    # Set star-rating if applicable
    if program['star-rating'] != '':
    output.append(' <star-rating><value>%s</value></star-rating>\n' % program['star-rating'])
    output.append(' </programme>\n')
    return "".join(output)
    def main():
    # Parse command line options
    try:
    opts, args = getopt.getopt(sys.argv[1:], "h", ["help", "output=", "capabilities",
    "preferredmethod", "days=",
    "configure", "fast", "slow",
    "cache=", "clean_cache",
    "slowdays=","compat",
    "desc-length=","description",
    "nocattrans","config-file=",
    "max_overlap=", "overlap_strategy=",
    "clear_cache", "quiet","logos="])
    except getopt.GetoptError:
    usage()
    sys.exit(2)
    # DEFAULT OPTIONS - Edit if you know what you are doing
    # where the output goes
    output = None
    output_file = None
    # the total number of days to fetch
    days = 6
    # Fetch data in fast mode, i.e. do NOT grab all the detail information,
    # fast means fast, because as it then does not have to fetch a web page for each program
    # Default: fast=0
    fast = 0
    # number of days to fetch in slow mode. For example: --days 5 --slowdays 2, will
    # fetch the first two days in slow mode (with all the details) and the remaining three
    # days in fast mode.
    slowdays = 6
    # no output
    quiet = 0
    # insert url of channel logo into the xml data, this will be picked up by mythfilldatabase
    logos = 1
    # enable this option if you were using tv_grab_nl, it adjusts the generated
    # xmltvid's so that everything works.
    compat = 0
    # enable this option if you do not want the tvgids categories being translated into
    # MythTV-categories (genres)
    nocattrans = 0
    # Maximum number of characters to use for program description.
    # Different values may work better in different versions of MythTV.
    desc_len = 475
    # default configuration file locations
    hpath = ''
    if os.environ.has_key('HOME'):
    hpath = os.environ['HOME']
    # extra test for windows users
    elif os.environ.has_key('HOMEPATH'):
    hpath = os.environ['HOMEPATH']
    # hpath = ''
    xmltv_dir = hpath+'/.xmltv'
    program_cache_file = xmltv_dir+'/program_cache'
    config_file = xmltv_dir+'/tv_grab_nl_py.conf'
    # cache the detail information.
    program_cache = None
    clean_cache = 1
    clear_cache = 0
    # seed the random generator
    random.seed(time.time())
    for o, a in opts:
    if o in ("-h", "--help"):
    usage()
    sys.exit(1)
    if o == "--quiet":
    quiet = 1;
    if o == "--description":
    print "The Netherlands (tv_grab_nl_py $Rev: 104 $)"
    sys.exit(0)
    if o == "--capabilities":
    print "baseline"
    print "cache"
    print "manualconfig"
    print "preferredmethod"
    sys.exit(0)
    if o == '--preferredmethod':
    print 'allatonce'
    sys.exit(0)
    if o == '--desc-length':
    # Use the requested length for programme descriptions.
    desc_len = int(a)
    if not quiet:
    sys.stderr.write('Using description length: %d\n' % desc_len)
    for o, a in opts:
    if o == "--config-file":
    # use the provided name for configuration
    config_file = a
    if not quiet:
    sys.stderr.write('Using config file: %s\n' % config_file)
    for o, a in opts:
    if o == "--configure":
    # check for the ~.xmltv dir
    if not os.path.exists(xmltv_dir):
    if not quiet:
    sys.stderr.write('You do not have the ~/.xmltv directory,')
    sys.stderr.write('I am going to make a shiny new one for you...')
    os.mkdir(xmltv_dir)
    if not quiet:
    sys.stderr.write('Creating config file: %s\n' % config_file)
    get_channels(config_file)
    sys.exit(0)
    if o == "--days":
    # limit days to maximum supported by tvgids.nl
    days = min(int(a),6)
    if o == "--compat":
    compat = 1
    if o == "--nocattrans":
    nocattrans = 1
    if o == "--fast":
    fast = 1
    if o == "--output":
    output_file = a
    try:
    output = open(output_file,'w')
    # and redirect output
    if debug:
    debug_file = open('/tmp/kaas.xml','w')
    blah = redirect.Tee(output, debug_file)
    sys.stdout = blah
    else:
    sys.stdout = output
    except:
    if not quiet:
    sys.stderr.write('Cannot write to outputfile: %s\n' % output_file)
    sys.exit(2)
    if o == "--slowdays":
    # limit slowdays to maximum supported by tvgids.nl
    slowdays = min(int(a),6)
    # slowdays implies fast == 0
    fast = 0
    if o == "--logos":
    logos = int(a)
    if o == "--clean_cache":
    clean_cache = 1
    if o == "--clear_cache":
    clear_cache = 1
    if o == "--cache":
    program_cache_file = a
    if o == "--max_overlap":
    max_overlap = int(a)
    if o == "--overlap_strategy":
    overlap_strategy = a
    # get configfile if available
    try:
    f = open(config_file,'r')
    except:
    sys.stderr.write('Config file %s not found.\n' % config_file)
    sys.stderr.write('Re-run me with the --configure flag.\n')
    sys.exit(1)
    #check for cache
    program_cache = ProgramCache(program_cache_file)
    if clean_cache != 0:
    program_cache.clean()
    if clear_cache != 0:
    program_cache.clear()
    # Go!
    channels = {}
    # Read the channel stuff
    for blah in f.readlines():
    blah = blah.lstrip()
    blah = blah.replace('\n','')
    if blah:
    if blah[0] != '#':
    channel = blah.split()
    channels[channel[0]] = " ".join(channel[1:])
    # channels are now in channels dict keyed on channel id
    # print header stuff
    print '<?xml version="1.0" encoding="ISO-8859-1"?>'
    print '<!DOCTYPE tv SYSTEM "xmltv.dtd">'
    print '<tv generator-info-name="tv_grab_nl_py $Rev: 104 $">'
    # first do the channel info
    for key in channels.keys():
    print ' <channel id="%s%s">' % (key, compat and '.tvgids.nl' or '')
    print ' <display-name lang="nl">%s</display-name>' % channels[key]
    if (logos):
    ikey = int(key)
    if logo_names.has_key(ikey):
    full_logo_url = logo_provider[logo_names[ikey][0]]+logo_names[ikey][1]+'.gif'
    print ' <icon src="%s" />' % full_logo_url
    print ' </channel>'
    num_chans = len(channels.keys())
    channel_cnt = 0
    if program_cache != None:
    program_cache.clean()
    fluffy = channels.keys()
    nfluffy = len(fluffy)
    for id in fluffy:
    channel_cnt += 1
    if not quiet:
    sys.stderr.write('\n\nNow fetching %s(xmltvid=%s%s) (channel %s of %s)\n' % \
    (channels[id], id, (compat and '.tvgids.nl' or ''), channel_cnt, nfluffy))
    info = get_channel_all_days(id, days, quiet)
    blah = parse_programs(info, None, quiet)
    # fetch descriptions
    if not fast:
    get_descriptions(blah, program_cache, nocattrans, quiet, slowdays)
    # Split titles with colon in it
    # Note: this only takes place if all days retrieved are also grabbed with details (slowdays=days)
    # otherwise this function might change some titles after a few grabs and thus may result in
    # loss of programmed recordings for these programs.
    if slowdays == days:
    for program in blah:
    title_split(program)
    print xmlefy_programs(blah, id, desc_len, compat, nocattrans)
    # save the cache after each channel fetch
    if program_cache != None:
    program_cache.dump(program_cache_file)
    # be nice to tvgids.nl
    time.sleep(random.randint(nice_time[0], nice_time[1]))
    if program_cache != None:
    program_cache.dump(program_cache_file)
    # print footer stuff
    print "</tv>"
    # close the outputfile if necessary
    if output != None:
    output.close()
    # and return success
    sys.exit(0)
    # allow this to be a module
    if __name__ == '__main__':
    main()
    # vim:tw=0:et:sw=4
    [cedric@tv ~]$
    Best regards,
    Cedric
    Last edited by cdwijs (2010-11-04 18:44:51)

    Running the script by python2 solves it for me:
    su - mythtv -c "nice -n 19 python2 /usr/bin/tv_grab_nl_py --output ~/listings.xml"
    Best regards,
    Cedric

  • [SOLVED] Symbolic links for python (v2) modules

    I was blind, sry
    To solve the issue:
    https://code.google.com/p/git-repo/issues/detail?id=168
    rm ~/.repopickle_.gitconfig
    Didn't work before for me as I made a dumb fail...
    Hello,
    I tried to understand and follow the wiki (https://wiki.archlinux.org/index.php/an … nvironment) about building Android as good as I could.
    Everything works till the part with setting the virtualenv2 for using python 2 (python -V gives v2.7.9 back). I understood everything till there, and even after that. Sadly it still doesn't work
    The first problem accuring is that when issueing
    ln -s /usr/lib/python2.7/* /Data/Android_Build/venv/lib/python2.7/
    I get "file exists" for every existing file. Is that wanted as it only should "add" modules not being in 'android/venv/lib/python-2.7/' ? After that I tried issueing 'repo init -u' but sadly this just gives me a python error.
    $ repo init -u https://github.com/CyanogenMod/android.git -b cm-12.0
    Traceback (most recent call last):
    File "/home/leonard/android/system/.repo/repo/main.py", line 500, in <module>
    _Main(sys.argv[1:])
    File "/home/leonard/android/system/.repo/repo/main.py", line 476, in _Main
    result = repo._Run(argv) or 0
    File "/home/leonard/android/system/.repo/repo/main.py", line 155, in _Run
    result = cmd.Execute(copts, cargs)
    File "/home/leonard/android/system/.repo/repo/subcmds/init.py", line 390, in Execute
    self._SyncManifest(opt)
    File "/home/leonard/android/system/.repo/repo/subcmds/init.py", line 149, in _SyncManifest
    print('Get %s' % GitConfig.ForUser().UrlInsteadOf(opt.manifest_url),
    File "/home/leonard/android/system/.repo/repo/git_config.py", line 219, in UrlInsteadOf
    for new_url in self.GetSubSections('url'):
    File "/home/leonard/android/system/.repo/repo/git_config.py", line 206, in GetSubSections
    return self._sections.get(section, set())
    File "/home/leonard/android/system/.repo/repo/git_config.py", line 230, in _sections
    for name in self._cache.keys():
    File "/home/leonard/android/system/.repo/repo/git_config.py", line 247, in _cache
    self._cache_dict = self._Read()
    File "/home/leonard/android/system/.repo/repo/git_config.py", line 251, in _Read
    d = self._ReadPickle()
    File "/home/leonard/android/system/.repo/repo/git_config.py", line 269, in _ReadPickle
    return pickle.load(fd)
    File "/home/leonard/android/venv/lib/python2.7/pickle.py", line 1378, in load
    return Unpickler(file).load()
    File "/home/leonard/android/venv/lib/python2.7/pickle.py", line 858, in load
    dispatch[key](self)
    File "/home/leonard/android/venv/lib/python2.7/pickle.py", line 886, in load_proto
    raise ValueError, "unsupported pickle protocol: %d" % proto
    ValueError: unsupported pickle protocol: 4
    Last edited by LeonardK (2015-01-03 17:40:18)

    Yes! You are right. Now, this sounds so familiar. I vaguely remember doing this when I originally installed Arch on this laptop, but I must have done it as part of the "beginners guide" procedure. I guess this explains it:
    https://wiki.archlinux.org/index.php?ti … did=168068
    Now, I take it from this that I safely remove ALL the symlinks from my rc.local?
    rc.local:
    ln -s /dev/sr0 /dev/cdrom
    ln -s /dev/sr0 /dev/cdrw
    ln -s /dev/sr0 /dev/dvd
    ln -s /dev/sr0 /dev/dvdrw

  • [SOLVED] Emacs Configuration

    I wanted to set my Emacs theme the default Emacs theme. So, I removed the line on my init.el that changed the theme. I reopened Emacs and my background was dark (gray), instead of Emacs's default white. Very strange, I thought. After lots of attempts to fix it, I ended up removing .emacs.d/, and completely uninstalling emacs, which removed /usr/share/emacs too. Total wipe out.
    ~> locate emacs
    /etc/speech-dispatcher/clients/emacs.conf
    /home/david/.emacs-places
    /home/david/.emacs.d
    /home/david/.emacs.e
    /home/david/config_emacs.zip
    /home/david/.config/hexchat/scrollback/FreeNode/#emacs.txt
    /home/david/.emacs.e/.git
    /home/david/.emacs.e/.gitignore
    /home/david/.emacs.e/README
    /home/david/.emacs.e/ac-comphist.dat
    /home/david/.emacs.e/ac-dict
    /home/david/.emacs.e/auto-complete-config.el
    /home/david/.emacs.e/auto-complete-config.elc
    /home/david/.emacs.e/auto-complete.el
    /home/david/.emacs.e/auto-complete.elc
    /home/david/.emacs.e/auto-save-list
    /home/david/.emacs.e/fixme-mode.el
    /home/david/.emacs.e/init.el
    /home/david/.emacs.e/lua-mode.el
    /home/david/.emacs.e/popup.el
    /home/david/.emacs.e/popup.elc
    /home/david/.emacs.e/redo+.el
    /home/david/.emacs.e/session.1023209c8141597e4134217547192611600000006250032
    /home/david/.emacs.e/tq.el
    /home/david/.emacs.e/tramp
    /home/david/.emacs.e/vala-mode.el
    /home/david/.emacs.e/ac-dict/c++-mode
    /home/david/.emacs.e/ac-dict/c-mode
    /home/david/.emacs.e/ac-dict/clojure-mode
    /home/david/.emacs.e/ac-dict/css-mode
    /home/david/.emacs.e/ac-dict/java-mode
    /home/david/.emacs.e/ac-dict/javascript-mode
    /home/david/.emacs.e/ac-dict/php-mode
    /home/david/.emacs.e/ac-dict/python-mode
    /home/david/.emacs.e/ac-dict/ruby-mode
    /home/david/.emacs.e/ac-dict/scheme-mode
    /home/david/.emacs.e/ac-dict/tcl-mode
    /home/david/.emacs.e/auto-save-list/.saves-11111-davidarch~
    /home/david/.emacs.e/auto-save-list/.saves-11933-davidarch~
    /home/david/.emacs.e/auto-save-list/.saves-13866-davidarch~
    /home/david/.emacs.e/auto-save-list/.saves-16864-davidarch~
    /home/david/.emacs.e/auto-save-list/.saves-1935-davidarch~
    /home/david/.emacs.e/auto-save-list/.saves-3635-davidarch~
    /home/david/.emacs.e/auto-save-list/.saves-4124-davidarch~
    /home/david/.emacs.e/auto-save-list/.saves-752-davidarch~
    /home/david/.emacs.e/auto-save-list/.saves-8016-davidarch~
    /home/david/.emacs.e/auto-save-list/.saves-9367-davidarch~
    /home/david/.local/share/Trash/files/vim_emacs.png.png
    /home/david/.local/share/Trash/info/vim_emacs.png.png.trashinfo
    /home/david/Downloads/emacs_resize.png
    /home/david/Downloads/CodeMirror-2.3/demo/emacs.html
    /home/david/Downloads/CodeMirror-2.3/keymap/emacs.js
    /home/david/src/.metadata/.plugins/com.python.pydev.analysis/python_v1_3tswbhuj9gc4kibexhrzgzdx/v1_indexcache/ropemacs.__init___eztp.v1_indexcache
    /opt/komodoedit/lib/mozilla/chrome/komododoc/locale/en-US/emacskeybind.html
    /usr/include/evolution-3.4/e-util/e-text-event-processor-emacs-like.h
    /usr/lib/erlang/lib/tools-2.6.7/emacs
    /usr/lib/erlang/lib/tools-2.6.7/emacs/README
    /usr/lib/erlang/lib/tools-2.6.7/emacs/erlang-eunit.el
    /usr/lib/erlang/lib/tools-2.6.7/emacs/erlang-flymake.el
    /usr/lib/erlang/lib/tools-2.6.7/emacs/erlang-skels-old.el
    /usr/lib/erlang/lib/tools-2.6.7/emacs/erlang-skels.el
    /usr/lib/erlang/lib/tools-2.6.7/emacs/erlang-start.el
    /usr/lib/erlang/lib/tools-2.6.7/emacs/erlang.el
    /usr/lib/erlang/lib/tools-2.6.7/emacs/erlang_appwiz.el
    /usr/lib/erlang/lib/tools-2.6.7/emacs/test.erl.indented
    /usr/lib/erlang/lib/tools-2.6.7/emacs/test.erl.orig
    /usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/tools/Editra/src/extern/pygments/styles/emacs.py
    /usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/tools/Editra/src/extern/pygments/styles/emacs.pyc
    /usr/lib/ruby/1.9.1/x86_64-linux/enc/emacs_mule.so
    /usr/share/fish/completions/emacs.fish
    /usr/share/gettext/styles/po-emacs-x.css
    /usr/share/gettext/styles/po-emacs-xterm.css
    /usr/share/gettext/styles/po-emacs-xterm16.css
    /usr/share/gettext/styles/po-emacs-xterm256.css
    /usr/share/git/emacs
    /usr/share/git/emacs/.gitignore
    /usr/share/git/emacs/Makefile
    /usr/share/git/emacs/README
    /usr/share/git/emacs/git-blame.el
    /usr/share/git/emacs/git-blame.elc
    /usr/share/git/emacs/git.el
    /usr/share/git/emacs/git.elc
    /usr/share/gnome/help/anjuta-manual/C/language-support-cpp-modelines-emacs.page
    /usr/share/gnome/help/anjuta-manual/cs/language-support-cpp-modelines-emacs.page
    /usr/share/gnome/help/anjuta-manual/da/language-support-cpp-modelines-emacs.page
    /usr/share/gnome/help/anjuta-manual/de/language-support-cpp-modelines-emacs.page
    /usr/share/gnome/help/anjuta-manual/el/language-support-cpp-modelines-emacs.page
    /usr/share/gnome/help/anjuta-manual/es/language-support-cpp-modelines-emacs.page
    /usr/share/gnome/help/anjuta-manual/eu/language-support-cpp-modelines-emacs.page
    /usr/share/gnome/help/anjuta-manual/fr/language-support-cpp-modelines-emacs.page
    /usr/share/gnome/help/anjuta-manual/gl/language-support-cpp-modelines-emacs.page
    /usr/share/gnome/help/anjuta-manual/ja/language-support-cpp-modelines-emacs.page
    /usr/share/gnome/help/anjuta-manual/oc/language-support-cpp-modelines-emacs.page
    /usr/share/gnome/help/anjuta-manual/pt_BR/language-support-cpp-modelines-emacs.page
    /usr/share/gnome/help/anjuta-manual/sl/language-support-cpp-modelines-emacs.page
    /usr/share/gnome/help/anjuta-manual/sv/language-support-cpp-modelines-emacs.page
    /usr/share/gnome/help/anjuta-manual/th/language-support-cpp-modelines-emacs.page
    /usr/share/gnome/help/anjuta-manual/uk/language-support-cpp-modelines-emacs.page
    /usr/share/gnome/help/anjuta-manual/zh_CN/language-support-cpp-modelines-emacs.page
    /usr/share/go/misc/emacs
    /usr/share/go/misc/emacs/go-mode-load.el
    /usr/share/go/misc/emacs/go-mode.el
    /usr/share/gtkhtml-4.0/keybindingsrc.emacs
    /usr/share/guile/1.8/ice-9/emacs.scm
    /usr/share/icons/Faenza/apps/16/emacs.png
    /usr/share/icons/Faenza/apps/16/emacs23.png
    /usr/share/icons/Faenza/apps/22/emacs.png
    /usr/share/icons/Faenza/apps/22/emacs23.png
    /usr/share/icons/Faenza/apps/24/emacs.png
    /usr/share/icons/Faenza/apps/24/emacs23.png
    /usr/share/icons/Faenza/apps/32/emacs.png
    /usr/share/icons/Faenza/apps/32/emacs23.png
    /usr/share/icons/Faenza/apps/48/emacs.png
    /usr/share/icons/Faenza/apps/48/emacs23.png
    /usr/share/icons/Faenza/apps/64/emacs.png
    /usr/share/icons/Faenza/apps/64/emacs23.png
    /usr/share/icons/Faenza/apps/96/emacs.png
    /usr/share/icons/Faenza/apps/96/emacs23.png
    /usr/share/icons/Faenza/apps/scalable/emacs.svg
    /usr/share/icons/Faenza/apps/scalable/emacs23.svg
    /usr/share/kbd/keymaps/i386/qwerty/emacs.map.gz
    /usr/share/kbd/keymaps/i386/qwerty/emacs2.map.gz
    /usr/share/mime/text/x-emacs-lisp.xml
    /usr/share/pixmaps/gnome-emacs.png
    /usr/share/speech-dispatcher/conf/clients/emacs.conf
    /usr/share/vim/vim73/colors/xemacs.vim
    That's "locate emacs". ~/.emacs.e/ is just a backup for ~/.emacs.d/, nothing is being loaded from .emacs.e, I'm sure.
    Either way, "pacman -R emacs" followed by "pacman -S emacs", and the background is still dark:
    >>moderator edit: The image is too large. Please read Forum Etiquette: Pasting Pictures and Code. Thanks. --fsckd<<
    I have no idea of what to do. I spent a few hours on this already, it's frustrating me quite a lot.
    Any ideas? Thank you so much.
    Last edited by ephan (2012-08-15 18:48:43)

    x-rix wrote:
    Are you getting any strange output if you are invoking emacs via command line?
    Also, what DE/WM are you using? I've had some funny colours in emacs and KDE in the past (that was the old KDE, though).
    (Btw, why pacman -R and not pacman -Rs?)
    Actually, Emacs isn't outputting a single character to terminal. I am using Openbox, and also tried Awesome WM, it worked the same.
    (I didn't know of -Rs, thank you )

  • [Solved]Missing dependency [dbus-sharp]

    I recently adopted a PKGBUILD that I like it's docky-stacks-bzr and when trying to fix it I'm getting this error :
    Running aclocal -I . -I m4/shamrock ...
    Running automake --copy --gnu ...
    Running autoconf ...
    Running intltoolize --force --copy --automake ...
    Running ./configure --prefix=/usr ...
    checking for a BSD-compatible install... /bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking how to create a pax tar archive... gnutar
    checking whether NLS is requested... yes
    checking for style of include used by make... GNU
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking dependency style of gcc... none
    checking for intltool >= 0.35.0... 0.41.1 found
    checking for intltool-update... /usr/bin/intltool-update
    checking for intltool-merge... /usr/bin/intltool-merge
    checking for intltool-extract... /usr/bin/intltool-extract
    checking for xgettext... /usr/bin/xgettext
    checking for msgmerge... /usr/bin/msgmerge
    checking for msgfmt... /usr/bin/msgfmt
    checking for gmsgfmt... /usr/bin/msgfmt
    checking for perl... /usr/bin/perl
    checking for perl >= 5.8.1... 5.12.1
    checking for XML::Parser... ok
    checking how to run the C preprocessor... gcc -E
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking locale.h usability... yes
    checking locale.h presence... yes
    checking for locale.h... yes
    checking for LC_MESSAGES... yes
    checking libintl.h usability... yes
    checking libintl.h presence... yes
    checking for libintl.h... yes
    checking for ngettext in libc... yes
    checking for dgettext in libc... yes
    checking for bind_textdomain_codeset... yes
    checking for msgfmt... (cached) /usr/bin/msgfmt
    checking for dcgettext... yes
    checking if msgfmt accepts -c... yes
    checking for gmsgfmt... (cached) /usr/bin/msgfmt
    checking for xgettext... (cached) /usr/bin/xgettext
    checking for catalogs to be installed... ast bg bn ca cs da de el en_GB es et eu fi fo fr gl he hi hr hu id is it ja ko lt nb nl nn pl pt pt_BR ro ru sk sl sv tr uk zh_CN zh_HK zh_TW
    checking for pkg-config... /usr/bin/pkg-config
    checking for gcc... (cached) gcc
    checking whether we are using the GNU C compiler... (cached) yes
    checking whether gcc accepts -g... (cached) yes
    checking for gcc option to accept ISO C89... (cached) none needed
    checking dependency style of gcc... (cached) none
    checking for ANSI C header files... (cached) yes
    checking for mono... /usr/bin/mono
    checking for gmcs... /usr/bin/gmcs
    checking pkg-config is at least version 0.9.0... yes
    checking for GCONF... yes
    checking for gconftool-2... /usr/bin/gconftool-2
    Using config source xml:merged:/etc/gconf/gconf.xml.defaults for schema installation
    Using $(sysconfdir)/gconf/schemas as install directory for schema files
    checking for GCONF_SHARP_20... yes
    checking for GLIB_SHARP_20... yes
    checking for GIO_SHARP... yes
    checking for GNOME_DESKTOP_SHARP_20... yes
    checking for GNOME_KEYRING_SHARP... yes
    checking for GTK_SHARP_20... yes
    checking for LIBRSVG_SHARP... yes
    checking for MONO_ADDINS... yes
    checking for MONO_ADDINS_GUI... yes
    checking for MONO_ADDINS_SETUP... yes
    checking for MONO_CAIRO... yes
    checking for DBUS_SHARP_10... no
    configure: error: Package requirements (dbus-sharp-1.0 >= 0.7) were not met:
    No package 'dbus-sharp-1.0' found
    Consider adjusting the PKG_CONFIG_PATH environment variable if you
    installed software in a non-standard prefix.
    Alternatively, you may set the environment variables DBUS_SHARP_10_CFLAGS
    and DBUS_SHARP_10_LIBS to avoid the need to call pkg-config.
    See the pkg-config man page for more details.
    Abortando...
    I looked in the repos and couldn't find it and looking in other places I found this http://www.ndesk.org/DBusSharp  but I am confussed about dbus-sharp and ndesk-dbus can some guide me
    thanks in advance
    Last edited by cruznick (2011-01-10 07:25:30)

    cruznick wrote:
    I recently adopted a PKGBUILD that I like it's docky-stacks-bzr and when trying to fix it I'm getting this error :
    Running aclocal -I . -I m4/shamrock ...
    Running automake --copy --gnu ...
    Running autoconf ...
    Running intltoolize --force --copy --automake ...
    Running ./configure --prefix=/usr ...
    checking for a BSD-compatible install... /bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking how to create a pax tar archive... gnutar
    checking whether NLS is requested... yes
    checking for style of include used by make... GNU
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking dependency style of gcc... none
    checking for intltool >= 0.35.0... 0.41.1 found
    checking for intltool-update... /usr/bin/intltool-update
    checking for intltool-merge... /usr/bin/intltool-merge
    checking for intltool-extract... /usr/bin/intltool-extract
    checking for xgettext... /usr/bin/xgettext
    checking for msgmerge... /usr/bin/msgmerge
    checking for msgfmt... /usr/bin/msgfmt
    checking for gmsgfmt... /usr/bin/msgfmt
    checking for perl... /usr/bin/perl
    checking for perl >= 5.8.1... 5.12.1
    checking for XML::Parser... ok
    checking how to run the C preprocessor... gcc -E
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking locale.h usability... yes
    checking locale.h presence... yes
    checking for locale.h... yes
    checking for LC_MESSAGES... yes
    checking libintl.h usability... yes
    checking libintl.h presence... yes
    checking for libintl.h... yes
    checking for ngettext in libc... yes
    checking for dgettext in libc... yes
    checking for bind_textdomain_codeset... yes
    checking for msgfmt... (cached) /usr/bin/msgfmt
    checking for dcgettext... yes
    checking if msgfmt accepts -c... yes
    checking for gmsgfmt... (cached) /usr/bin/msgfmt
    checking for xgettext... (cached) /usr/bin/xgettext
    checking for catalogs to be installed... ast bg bn ca cs da de el en_GB es et eu fi fo fr gl he hi hr hu id is it ja ko lt nb nl nn pl pt pt_BR ro ru sk sl sv tr uk zh_CN zh_HK zh_TW
    checking for pkg-config... /usr/bin/pkg-config
    checking for gcc... (cached) gcc
    checking whether we are using the GNU C compiler... (cached) yes
    checking whether gcc accepts -g... (cached) yes
    checking for gcc option to accept ISO C89... (cached) none needed
    checking dependency style of gcc... (cached) none
    checking for ANSI C header files... (cached) yes
    checking for mono... /usr/bin/mono
    checking for gmcs... /usr/bin/gmcs
    checking pkg-config is at least version 0.9.0... yes
    checking for GCONF... yes
    checking for gconftool-2... /usr/bin/gconftool-2
    Using config source xml:merged:/etc/gconf/gconf.xml.defaults for schema installation
    Using $(sysconfdir)/gconf/schemas as install directory for schema files
    checking for GCONF_SHARP_20... yes
    checking for GLIB_SHARP_20... yes
    checking for GIO_SHARP... yes
    checking for GNOME_DESKTOP_SHARP_20... yes
    checking for GNOME_KEYRING_SHARP... yes
    checking for GTK_SHARP_20... yes
    checking for LIBRSVG_SHARP... yes
    checking for MONO_ADDINS... yes
    checking for MONO_ADDINS_GUI... yes
    checking for MONO_ADDINS_SETUP... yes
    checking for MONO_CAIRO... yes
    checking for DBUS_SHARP_10... no
    configure: error: Package requirements (dbus-sharp-1.0 >= 0.7) were not met:
    No package 'dbus-sharp-1.0' found
    Consider adjusting the PKG_CONFIG_PATH environment variable if you
    installed software in a non-standard prefix.
    Alternatively, you may set the environment variables DBUS_SHARP_10_CFLAGS
    and DBUS_SHARP_10_LIBS to avoid the need to call pkg-config.
    See the pkg-config man page for more details.
    Abortando...
    I looked in the repos and couldn't find it and looking in other places I found this http://www.ndesk.org/DBusSharp  but I am confussed about dbus-sharp and ndesk-dbus can some guide me
    thanks in advance
    And you marked docky-bzr for this?
    By the way, I'm having the same issue; writing a PKGBUILD for ndesk-dbus-git didn't work: the configure continues to ask me about dbus-sharp-1.0 -.-
    EDIT: Solved; we have to update from ndesk-dbus to dbus-sharp
    I'm working from now on a dbus-sharp PKGBUILD
    EDIT²: PKGBUILDs for dbus-sharp and dbus-sharp-glib are now on AUR; the only issue is that they are "heavy" forks of ndesk dbus, so installing them you will broke many of your Mono apps, until Arch will not build them with dbus-sharp support. I tried to recompile Tomboy without any patch but it doesn't build.
    GNOME Do works (with some warnings) out of the box; Docky needs to be rebuilt using the GIT tree.
    Last edited by Bl@ster (2010-10-16 09:48:22)

  • [SOLVED] emacs-w3m

    I'm probably missing something obvious here, but I've installed both emacs-w3m and w3m, yet can't figure out how to use it!
    I've tried M-x emacs-w3m, M-x w3m and M-x w3m-emacs. How do I run it?
    edit: I googled and solved it by adding the following to my ~/.emacs file
    (require 'w3m-load)
    (require 'mime-w3m)
    Last edited by Barrucadu (2008-06-26 18:02:56)

    Yeah I figured that out when I got back home. It was my own fault for running emacs from Run Program in xfce instead of from the Terminal.
    However, I've installed that package along with the 75dpi one and it still doesn't work. I even ran fc-cache again just to be sure. Weird.
    The error is "Warning: Cannot convert string "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*" to type FontStruct" So perhaps it's a fontconfig problem. Both fontconfig and freetype2 as up-to-date. Hmm.
    [EDIT] I restared X and everything worked. Thanks. I've updated the wiki with the information. I'll send a diff to the maintainer at some point; the PKGBUILD should really tell the user that he/she needs to install these fonts if using X windows
    Last edited by Weeks (2007-05-05 23:32:05)

  • [solved] Emacs crashes

    Hi, since the update today I'm experiencing strange emacs crashes...
    I'm afraid the log is not very informative...
    Fatal error 11: Segmentation fault
    Backtrace:
    emacs[0x503093]
    emacs[0x4e9aae]
    emacs[0x501eae]
    emacs[0x501f13]
    /usr/lib/libpthread.so.0(+0x10740)[0x7f1f9cf86740]
    emacs[0x4a8a9a]
    emacs[0x4ad9e4]
    emacs[0x441e6f]
    emacs[0x45f3fb]
    emacs[0x4634f3]
    emacs[0x55a26b]
    emacs[0x430cce]
    emacs[0x4516ea]
    emacs[0x4f4551]
    emacs[0x4f5ccf]
    emacs[0x4f7a40]
    emacs[0x55a147]
    emacs[0x4e9f4e]
    emacs[0x55a02b]
    emacs[0x4ee567]
    emacs[0x4ee880]
    emacs[0x418119]
    /usr/lib/libc.so.6(__libc_start_main+0xf0)[0x7f1f9cbf3800]
    emacs[0x418bce]
    [1] 18795 segmentation fault (core dumped) emacs --debug-init
    Maybe a better debug log: http://pastie.org/10101800
    Is there anyone having also these problems?
    NOTE: I closed the issue and mark it as "solved" since it seems to be OK since the update to emacs 24.5...
    Last edited by rogorido (2015-04-22 08:06:00)

    Alad wrote:If you don't mind use [Solved] or similar instead of [closed]. Closed is what appears next to the title if a moderator actually closes the topic.
    I wouldn't mind, but it is not really solved. Today it happened again... I'm analyzing whether some (emacs) package I installed could be the reason for these crashes...

  • [solved] Problem compialing boost python example on Arch.

    I have bean trying to compile the basic boost.python example program on arch, but g++ is spitting out errors stating that it cannot find Python.h and so on.
    #include <boost/python.hpp>
    char const* greet()
    return "hello, world";
    BOOST_PYTHON_MODULE(hello_ext)
    using namespace boost::python;
    def("greet", greet);
    g++ boost_python_test.cpp
    In file included from /usr/include/boost/python/detail/prefix.hpp:13,
    from /usr/include/boost/python/args.hpp:8,
    from /usr/include/boost/python.hpp:11,
    from boost_python_test.cpp:1:
    /usr/include/boost/python/detail/wrap_python.hpp:50:23: error: pyconfig.h: No such file or directory
    /usr/include/boost/python/detail/wrap_python.hpp:75:24: error: patchlevel.h: No such file or directory
    /usr/include/boost/python/detail/wrap_python.hpp:78:2: error: #error Python 2.2 or higher is required for this version of Boost.Python.
    /usr/include/boost/python/detail/wrap_python.hpp:142:21: error: Python.h: No such file or directory
    ^C
    tonnes of errors.
    Last edited by Hessiess (2009-04-30 21:25:26)

    JK3mp wrote:Don't forget to put SOLVED in the title on your solved issue's please.
    Done

  • [SOLVED] Emacs `forward-sentence' broken?

    Hello there,
    at least for me the behaviour of the `forward-sentence' function (normally bound to M-e) in GNU Emacs doesn't work right.
    After pasting the following paragraph to a buffer
    wikipedia wrote:Maximilian Karl Emil "Max" Weber was a German sociologist, philosopher, and political economist whose ideas influenced social theory, social research, and the entire discipline of sociology. Weber is often cited, with Émile Durkheim and Karl Marx, as among the three founding architects of sociology.
    I place the cursor to the beginning of the paragraph, i.e. just before "Maximilian". Then pressing M-e brings the cursor to the end of the paragraph. But the intended behaviour is to bring the cursor to the end of the first sentence, i.e. after the first "sociology", right before "Weber", isn't it? Is this a bug I should report?
    I tried this after starting up emacs by
    $ emacs -Q
    Emacs version 24.3.1
    [EDIT]: Post on the mailing list: http://article.gmane.org/gmane.emacs.help/93608
    [EDIT2]: It's solved: http://article.gmane.org/gmane.emacs.help/93612
    Last edited by ball (2013-09-26 15:53:10)

    Hello there,
    at least for me the behaviour of the `forward-sentence' function (normally bound to M-e) in GNU Emacs doesn't work right.
    After pasting the following paragraph to a buffer
    wikipedia wrote:Maximilian Karl Emil "Max" Weber was a German sociologist, philosopher, and political economist whose ideas influenced social theory, social research, and the entire discipline of sociology. Weber is often cited, with Émile Durkheim and Karl Marx, as among the three founding architects of sociology.
    I place the cursor to the beginning of the paragraph, i.e. just before "Maximilian". Then pressing M-e brings the cursor to the end of the paragraph. But the intended behaviour is to bring the cursor to the end of the first sentence, i.e. after the first "sociology", right before "Weber", isn't it? Is this a bug I should report?
    I tried this after starting up emacs by
    $ emacs -Q
    Emacs version 24.3.1
    [EDIT]: Post on the mailing list: http://article.gmane.org/gmane.emacs.help/93608
    [EDIT2]: It's solved: http://article.gmane.org/gmane.emacs.help/93612
    Last edited by ball (2013-09-26 15:53:10)

  • [solved] fglrx depend? I have NVIDIA!

    Okay, take a look.
    So simple programs, so many weird dependencies, it doesn't make any sense, especially the radeon utility program fglrx-utils, xinetd, and netbsd-bsd-finger.
    I DO NOT have a Radeon graphics card! I have an Nvidia, using the official nvidia drivers.
    [root@dezza dezza]# pacman -S perlpanel
    resolving dependencies... done.
    looking for inter-conflicts... done.
    Targets: audiofile-0.2.6-3 esd-0.2.38-3 xinetd-2.3.14-2
    netkit-bsd-finger-0.17-3 fglrx-utils-8.40.4-1 xmms-1.2.10-9
    perl-xmms-0.12-2 perlxml-2.34-4 perl-xml-simple-2.18-1
    glib-perl-1.144-1 cairo-perl-1.041-1 gtk2-perl-1.146-1
    glade-perl-1.006-1 perl-extutils-depends-0.205-2
    perl-extutils-pkgconfig-1.07-2 libart-lgpl-2.3.19-1
    libgnomecanvas-2.14.0-2 gnomecanvas-perl-1.002-3
    gnome-vfs-perl-1.061-1 libbonobo-2.18.0-2 libgnome-2.18.0-2
    libbonoboui-2.18.0-2 gnome-keyring-0.8.1-2 libgnomeui-2.18.1-2
    gnome-perl-1.042-1 perl-gnome2-wnck-0.12-4
    perl-locale-gettext-1.05-2 perl-date-manip-5.44-2 perlpanel-0.9.1-3
    Total Package Size: 19,68 MB
    Proceed with installation? [Y/n]
    [root@dezza dezza]# pacman -S xfe
    resolving dependencies... done.
    looking for inter-conflicts... done.
    Targets: fglrx-utils-8.40.4-1 glproto-1.4.8-1 mesa-6.5.2-1 fox-1.6.29-1
    xfe-1.04-1 xinetd-2.3.14-2 netkit-bsd-finger-0.17-3
    Total Package Size: 15,67 MB
    Proceed with installation? [Y/n]
    I would really like to know what causes this, cause it will overwrite my libGL libraries and mesa where pacman is my savior:
    checking package integrity... done.
    cleaning up... done.
    (7/7) checking for file conflicts [#####################] 100%
    error: could not prepare transaction
    error: failed to commit transaction (conflicting files)
    fglrx-utils: /usr/lib/libGL.so exists in filesystem
    fglrx-utils: /usr/lib/libGL.so.1 exists in filesystem
    fglrx-utils: /usr/lib/xorg/modules/extensions/libglx.so exists in filesystem
    mesa: /usr/include/GL/gl.h exists in filesystem
    mesa: /usr/include/GL/glext.h exists in filesystem
    mesa: /usr/include/GL/glx.h exists in filesystem
    mesa: /usr/include/GL/glxext.h exists in filesystem
    errors occurred, no packages were upgraded.
    I would really much like to know what the cause of this problem is and how to fix it, or where in the database pacman screws up?
    Last edited by dezza (2007-10-07 11:44:36)

    dezza wrote:
    I did like you told me, created a libgl dummy pkg with no files in it, and installed it.
    Then mesa still is a depend of xfe and many packages as well, and if I try to install mesa:
    mesa: /usr/include/GL/gl.h exists in filesystem
    mesa: /usr/include/GL/glext.h exists in filesystem
    mesa: /usr/include/GL/glx.h exists in filesystem
    mesa: /usr/include/GL/glxext.h exists in filesystem
    So I create another mesa dummy package and installed that aswell.
    Now I am missing "libGLU.so.1" when trying to start programs that depend on mesa (such as xfe), so the official NVIDIA drivers provide these files that is with the mesa package, but is missing "libGLU.so.1", is there an alternative library that provides it, or should I make another workaround or what is the proper way to fix this? I like having a custom kernel, and from what I've read the nvidia package from pacman only works with stock kernels.
    pacman -S nvidia-utils. Includes the userspace stuff, doesnt include the kernel module.
    Even better, would be to install the nvidia module with pacman, take the 'nvidia' PKGBUILD, change pkgname, adjust _kernver, fix the dependencies, and build.
    James

  • [solved] emacs won't start

    I'm interested in learning some lisp and it seems like emacs+slime is the way to go (even though I perfer vim).
    Seems like there is something weird with my configuration somewhere, because it won't run.
    $>emacs
    emacs: Invalid visual specification `DirectColor'
    $>
    I'm not entirely sure what to change, I tried adding "Emacs.visualClass: TrueColor" to /etc/X11/app-defaults/Emacs but it doesn't seem to do anything.
    Edit: meh. Forgot that you have to reload the .Xdefaults
    Last edited by scj (2007-12-08 13:12:25)

    I did search. Ok, I suck at choosing the best search terms. I searched again, as you advised, and the answer in this thread https://bbs.archlinux.org/viewtopic.php?id=89043 did the trick. Apologies for not finding the obvious. And, as always, thanks for the assistance.

  • [solved] Emacs in X windows - Characters are not displayed

    Emacs works fine when run with -nw.
    But when I run it without, in X Windows, emacs does not display characters properly. It just displays those whites boxes with the black borders. The ones you see when you're trying to view characters for which you don't have the right font.
    I installed XEmacs, and that worked fine. I don't understand why the normal Emacs doesn't.
    I'll post a screenshot when I'm home from work, but you should get the gist of the problem.
    Last edited by Weeks (2007-05-05 23:18:59)

    Yeah I figured that out when I got back home. It was my own fault for running emacs from Run Program in xfce instead of from the Terminal.
    However, I've installed that package along with the 75dpi one and it still doesn't work. I even ran fc-cache again just to be sure. Weird.
    The error is "Warning: Cannot convert string "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*" to type FontStruct" So perhaps it's a fontconfig problem. Both fontconfig and freetype2 as up-to-date. Hmm.
    [EDIT] I restared X and everything worked. Thanks. I've updated the wiki with the information. I'll send a diff to the maintainer at some point; the PKGBUILD should really tell the user that he/she needs to install these fonts if using X windows
    Last edited by Weeks (2007-05-05 23:32:05)

  • [solved] Missing dependency with Mousepad?

    Pardon if this is wrong forum. I'm still very new to Arch.
    xfce4's mousepad would not print. Other apps would, but not mousepad. You could not adjust things like paper type (letter, legal, etc) or other printer options. If you tried to print, mousepad would say:
    client-error-bad-request
    On this xfce4 forum: (http://forum.xfce.org/index.php?action= … =showPosts)
    Where I found that, apparently mousepad needs the package a2ps.
    Sure enough, that solved it for me.
    Hopefully, this message will get to the right people with Arch.  I really enjoy Arch so far, and I'm just trying to help in any way...
    Last edited by Seleven (2007-02-19 16:39:12)

    Thanks! You just solved my problem in 30 seconds. :-)
    Is it possible to put a2ps in the mousepad's dependencies?
    I love the power of arch and xfce...

Maybe you are looking for