From b1ee44e5e2e89d4969a6324674c7f122881aa4b8 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Wed, 25 Jun 2008 20:26:45 +0200 Subject: Added 2.2 settings --- portato/backend/portage/setting_22.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 portato/backend/portage/setting_22.py (limited to 'portato') diff --git a/portato/backend/portage/setting_22.py b/portato/backend/portage/setting_22.py new file mode 100644 index 0000000..4e68d7c --- /dev/null +++ b/portato/backend/portage/setting_22.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# +# File: portato/backend/portage/settings_22.py +# This file is part of the Portato-Project, a graphical portage-frontend. +# +# Copyright (C) 2008 René 'Necoro' Neumann +# This is free software. You may redistribute copies of it under the terms of +# the GNU General Public License version 2. +# There is NO WARRANTY, to the extent permitted by law. +# +# Written by René 'Necoro' Neumann + +from __future__ import absolute_import + +import portage +from .settings import PortageSettings + +class PortageSettings_22 (PortageSettings): + """Enhances the normal PortageSettings in ways, that it adds the setsconfig.""" + + def __init__ (self): + PortageSettings.__init__(self) + + def load (self): + PortageSettings.load(self) + + self.setsconfig = portage.sets.load_default_config(self.settings, self.trees[self.settings["ROOT"]]) -- cgit v1.2.3-54-g00ecf From d5c4405e9e37c7793033fe190c9507eb5e39dcc5 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Wed, 25 Jun 2008 21:09:17 +0200 Subject: Added Package_22 and System_22 --- portato/backend/portage/package.py | 7 ++++++- portato/backend/portage/package_22.py | 22 ++++++++++++++++++++++ portato/backend/portage/system.py | 8 ++++---- portato/backend/portage/system_22.py | 31 +++++++++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 5 deletions(-) create mode 100644 portato/backend/portage/package_22.py create mode 100644 portato/backend/portage/system_22.py (limited to 'portato') diff --git a/portato/backend/portage/package.py b/portato/backend/portage/package.py index db9866a..78125ee 100644 --- a/portato/backend/portage/package.py +++ b/portato/backend/portage/package.py @@ -18,7 +18,12 @@ from .. import system from ..exceptions import BlockedException, PackageNotFoundException, DependencyCalcError from ...helper import debug, error, unique_array -import portage, portage_dep +import portage + +try: + import portage.dep as portage_dep +except ImportError: + import portage_dep import os.path diff --git a/portato/backend/portage/package_22.py b/portato/backend/portage/package_22.py new file mode 100644 index 0000000..4fe03d9 --- /dev/null +++ b/portato/backend/portage/package_22.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# +# File: portato/backend/portage/package_22.py +# This file is part of the Portato-Project, a graphical portage-frontend. +# +# Copyright (C) 2008 René 'Necoro' Neumann +# This is free software. You may redistribute copies of it under the terms of +# the GNU General Public License version 2. +# There is NO WARRANTY, to the extent permitted by law. +# +# Written by René 'Necoro' Neumann + +from __future__ import absolute_import, with_statement + +from .package import PortagePackage + +class PortagePackage_22 (PortagePackage): + """ + The 2.2 specialization of the portage package. + Currently this is identical to the normal one. + """ + pass diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py index 0d81945..db6b6ea 100644 --- a/portato/backend/portage/system.py +++ b/portato/backend/portage/system.py @@ -142,7 +142,7 @@ class PortageSystem (SystemInterface): """ if not only_cpv: - return [PortagePackage(x) for x in list_of_packages] + return [self.new_package(x) for x in list_of_packages] else: return list_of_packages @@ -154,7 +154,7 @@ class PortageSystem (SystemInterface): if only_cpv: return portage.best(list) else: - return PortagePackage(portage.best(list)) + return self.new_package(portage.best(list)) def find_best_match (self, search_key, masked = False, only_installed = False, only_cpv = False): t = [] @@ -287,7 +287,7 @@ class PortageSystem (SystemInterface): unresolved = [] for x in list: cpv = x.strip() - if len(cpv) and check(cpv): + if cpv and check(cpv): pkg = self.find_best_match(cpv, only_cpv = only_cpv) if pkg: resolved.append(pkg) @@ -304,7 +304,7 @@ class PortageSystem (SystemInterface): return portage.catpkgsplit(cpv) def sort_package_list(self, pkglist): - pkglist.sort(PortagePackage.compare_version) + pkglist.sort(PortagePackage.compare_version) # XXX: waaah ... direct package naming... =/ return pkglist def reload_settings (self): diff --git a/portato/backend/portage/system_22.py b/portato/backend/portage/system_22.py new file mode 100644 index 0000000..a4ea4a0 --- /dev/null +++ b/portato/backend/portage/system_22.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# +# File: portato/backend/portage/system_22.py +# This file is part of the Portato-Project, a graphical portage-frontend. +# +# Copyright (C) 2008 René 'Necoro' Neumann +# This is free software. You may redistribute copies of it under the terms of +# the GNU General Public License version 2. +# There is NO WARRANTY, to the extent permitted by law. +# +# Written by René 'Necoro' Neumann + +from __future__ import absolute_import, with_statement + +from .package_22 import PortagePackage_22 +from .settings_22 import PortageSettings_22 +from .system import PortageSystem + +class PortageSystem_22 (PortageSystem): + + def __init__ (self): + self.settings = PortageSettings_22() + portage.WORLD_FILE = os.path.join(self.settings.settings["ROOT"],portage.WORLD_FILE) + + self.use_descs = {} + self.local_use_descs = defaultdict(dict) + + self._version = tuple([x.split("_")[0] for x in portage.VERSION.split(".")]) + + def new_package (self, cpv): + return PortagePackage_22(cpv) -- cgit v1.2.3-54-g00ecf From 9f820103c30e89376a0484c614d2bbc068998e48 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Wed, 25 Jun 2008 21:26:05 +0200 Subject: Now load 22 versions when running the correct portage --- portato/backend/portage/__init__.py | 12 ++++++++++-- portato/backend/portage/setting_22.py | 27 --------------------------- portato/backend/portage/settings_22.py | 27 +++++++++++++++++++++++++++ portato/backend/portage/system.py | 5 ++--- portato/backend/portage/system_22.py | 7 +++++-- 5 files changed, 44 insertions(+), 34 deletions(-) delete mode 100644 portato/backend/portage/setting_22.py create mode 100644 portato/backend/portage/settings_22.py (limited to 'portato') diff --git a/portato/backend/portage/__init__.py b/portato/backend/portage/__init__.py index 6ccbf7f..be6cce6 100644 --- a/portato/backend/portage/__init__.py +++ b/portato/backend/portage/__init__.py @@ -12,5 +12,13 @@ from __future__ import absolute_import -from .system import PortageSystem -from .package import PortagePackage +from portage import VERSION as PV + +VERSION = tuple(map(int, (x.split("_")[0] for x in PV.split(".")))) + +if VERSION >= (2, 2): + from .system_22 import PortageSystem_22 as PortageSystem + from .package_22 import PortagePackage_22 as PortagePackage +else: + from .system import PortageSystem + from .package import PortagePackage diff --git a/portato/backend/portage/setting_22.py b/portato/backend/portage/setting_22.py deleted file mode 100644 index 4e68d7c..0000000 --- a/portato/backend/portage/setting_22.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -# -# File: portato/backend/portage/settings_22.py -# This file is part of the Portato-Project, a graphical portage-frontend. -# -# Copyright (C) 2008 René 'Necoro' Neumann -# This is free software. You may redistribute copies of it under the terms of -# the GNU General Public License version 2. -# There is NO WARRANTY, to the extent permitted by law. -# -# Written by René 'Necoro' Neumann - -from __future__ import absolute_import - -import portage -from .settings import PortageSettings - -class PortageSettings_22 (PortageSettings): - """Enhances the normal PortageSettings in ways, that it adds the setsconfig.""" - - def __init__ (self): - PortageSettings.__init__(self) - - def load (self): - PortageSettings.load(self) - - self.setsconfig = portage.sets.load_default_config(self.settings, self.trees[self.settings["ROOT"]]) diff --git a/portato/backend/portage/settings_22.py b/portato/backend/portage/settings_22.py new file mode 100644 index 0000000..a43d69e --- /dev/null +++ b/portato/backend/portage/settings_22.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# +# File: portato/backend/portage/settings_22.py +# This file is part of the Portato-Project, a graphical portage-frontend. +# +# Copyright (C) 2008 René 'Necoro' Neumann +# This is free software. You may redistribute copies of it under the terms of +# the GNU General Public License version 2. +# There is NO WARRANTY, to the extent permitted by law. +# +# Written by René 'Necoro' Neumann + +from __future__ import absolute_import + +import portage.sets +from .settings import PortageSettings + +class PortageSettings_22 (PortageSettings): + """Enhances the normal PortageSettings in ways, that it adds the setsconfig.""" + + def __init__ (self): + PortageSettings.__init__(self) + + def load (self): + PortageSettings.load(self) + + self.setsconfig = portage.sets.load_default_config(self.settings, self.trees[self.settings["ROOT"]]) diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py index db6b6ea..feaf4df 100644 --- a/portato/backend/portage/system.py +++ b/portato/backend/portage/system.py @@ -16,6 +16,7 @@ import re, os, os.path import portage from collections import defaultdict +from . import VERSION from .package import PortagePackage from .settings import PortageSettings from ..system_interface import SystemInterface @@ -36,8 +37,6 @@ class PortageSystem (SystemInterface): self.use_descs = {} self.local_use_descs = defaultdict(dict) - self._version = tuple([x.split("_")[0] for x in portage.VERSION.split(".")]) - def get_version (self): return "Portage %s" % portage.VERSION @@ -166,7 +165,7 @@ class PortageSystem (SystemInterface): t = self.find_packages(search_key, pkgSet = pkgSet, masked = masked, with_version = True, only_cpv = True) - if self._version >= (2,1,5): + if VERSION >= (2,1,5): t += [pkg.get_cpv() for pkg in self.find_packages(search_key, "installed") if not (pkg.is_testing(True) or pkg.is_masked())] else: t = self.find_packages(search_key, "installed", only_cpv=True) diff --git a/portato/backend/portage/system_22.py b/portato/backend/portage/system_22.py index a4ea4a0..be27186 100644 --- a/portato/backend/portage/system_22.py +++ b/portato/backend/portage/system_22.py @@ -12,6 +12,11 @@ from __future__ import absolute_import, with_statement +import os +import portage + +from collections import defaultdict + from .package_22 import PortagePackage_22 from .settings_22 import PortageSettings_22 from .system import PortageSystem @@ -25,7 +30,5 @@ class PortageSystem_22 (PortageSystem): self.use_descs = {} self.local_use_descs = defaultdict(dict) - self._version = tuple([x.split("_")[0] for x in portage.VERSION.split(".")]) - def new_package (self, cpv): return PortagePackage_22(cpv) -- cgit v1.2.3-54-g00ecf ow special characters like umlauts in the folder name (see the > attached patch). > > Problem is, that the encode_utf7 (and the decode_utf7 FWIW) uses the > 'String::force_encoding' method, which some googling shows to be in > Ruby1.9 but not 1.8. 2010-12-01robustify config parsingLucas Nussbaum1-11/+22 2010-11-30Also add reupload_if_updated for MaildirsLucas Nussbaum1-1/+4 2010-11-30Add a reupload_if_updated option (default: true)Lucas Nussbaum4-8/+20 Following a discussion on feed2imap-devel, add a reupload_if_updated option. When set to false, if an item is updated, but was previously removed from the IMAP server, it is no longer re-uploaded. Also fix some config file parsing bugs for the disable-ssl-verification and include-images options. I should really switch to another way to describe F2I config... 2010-07-05Patch to use feed item pubDate in Maildir file namesBernie Maier1-6/+10 Hi! I've just subscribed to the list, having downloaded feed2imap a few days ago. Since I want to just write RSS feeds to a local Maildir, this looked like just what I needed. Unfortunately, the release 1.0 version seems to randomise the order of the feed items when doing the first fetch for a new feed. Looking at maildir.rb, there is a "TODO: handle `date'" comment and it looks like the code is just generating maildir filenames using the timestamp at the time the items are being written into the maildir. Since all the initial items are written at the same time, and the maildir file name has a random element, this loses the original ordering from the mail feed. The solution is to use the timestamp corresponding to the pubDate in the feed item as the initial component of the maildir file name. Also, instead of using a random integer to force uniqueness in the second component of the file name, I think it is better to use a sequence number for each feed item, which will still be unique for the feed and also preserve item order. My patch follows (it's the first piece of Ruby code I've ever written / modified)... Cheers, Bernie 2010-04-18update websiteLucas Nussbaum2-2/+15 2010-04-18prepare releaseLucas Nussbaum4-5/+5 2010-04-18provide a way to disable SSL certificate verificationLucas Nussbaum4-1/+12 2010-04-18update changelogLucas Nussbaum1-0/+4 2010-04-18Update rubyimap.rbLucas Nussbaum1-5/+38 Update rubyimap.rb to upstream revision 27336 2010-03-17Document the maildir targetSandra Snan3-5/+5 I looked for a good feed to maildir program, and I couldn’t find one. Turns out, by looking at feed2imaps source code, that it has that function. So here’s a documentation patch so it’s easier to find. This patch shouldn’t touch any code. Generated by git. Sandra Signed-off-by: Sandra Snan <sandra.snan@handgranat.org> 2009-12-26Avoid using "acme.com"Lucas Nussbaum4-10/+19 Patch from Guido Berhoerster <guido@berhoerster.name>: Hello, here is a small patch that avoids using the valid(!) domain "acme.com" for generating message ids and email addresses. It adds a new global configuration option "default-email" which will be used in case a feed does provide one, currently feed2imap resorts to "feed2imap@acme.com". If this configuration option is not given it will basically default to <logname>@<hostname> as returned by Etc.getlogin and Socket.gethostname. Yours, 2009-09-04fix to use Message-Id instead of X-CacheIndexLucas Nussbaum1-5/+2 2009-09-03added the forth arg to ConfigFeed::new for maildirLucas Nussbaum1-1/+1