From d041a06226aec18308b846bd90ef99a744367f3e Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Fri, 14 Aug 2009 17:13:19 +0200 Subject: Add package and category objects --- portato/eix/parser.py | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'portato/eix/parser.py') diff --git a/portato/eix/parser.py b/portato/eix/parser.py index 44c4214..ac49789 100644 --- a/portato/eix/parser.py +++ b/portato/eix/parser.py @@ -14,11 +14,10 @@ from __future__ import absolute_import, with_statement import os import struct - -from ..helper import debug from functools import partial -from . import exceptions as ex +from ..helper import debug +from .exceptions import EndOfFileException def _get_bytes (file, length, expect_list = False): s = file.read(length) @@ -137,3 +136,30 @@ class header (object): self.useflags = LE(typed_vector(string)) self.slots = LE(typed_vector(string)) self.sets = LE(typed_vector(string)) + +class package (object): + def __init__ (self, file, skip = False): + def LE (t): + return LazyElement(t, file) + + self.offset = number(file) + + after_offset = file.tell() + + self.name = LE(string) + self.description = LE(string) + self.provide = LE(typed_vector(number)) + self.homepage = LE(string) + self.license = LE(number) + self.useflags = LE(typed_vector(number)) + + # self.versions = LE(typed_vector(version)) + # for the moment just skip the versions + file.seek(self.offset - (file.tell() - after_offset), os.SEEK_CUR) + +class category (object): + __slots__ = ("name", "packages") + + def __init__ (self, file, skip = False): + self.name = LazyElement(string, file) + self.packages = LazyElement(typed_vector(package), file) -- cgit v1.2.3-54-g00ecf class='right' method='get' action='/feed2imap-go.git/log/internal/feed/template/funcs.go'>
path: root/internal/feed/template/funcs.go (unfollow)
Commit message (Expand)AuthorFilesLines
2024-02-29Replace util.Contains with slices.ContainsRené 'Necoro' Neumann5-21/+9
2024-02-29Pass -1 instead of nil to avoid having an int*René 'Necoro' Neumann1-9/+9
2024-02-28Upgrade dependenciesRené 'Necoro' Neumann2-26/+24
2024-01-28Bump github.com/emersion/go-message from 0.17.0 to 0.18.0dependabot[bot]2-4/+3
2024-01-03Update gofeed depRené 'Necoro' Neumann2-3/+3
2024-01-03Move antonmedv/expr => expr-lang/exprRené 'Necoro' Neumann3-5/+5
2024-01-03Upgrade depsRené 'Necoro' Neumann2-21/+21
2024-01-03Bump actions/setup-go from 4 to 5dependabot[bot]2-2/+2
2023-10-07Bump golang.org/x/net from 0.15.0 to 0.16.0dependabot[bot]2-3/+3
2023-09-20Upgrade expr (again.......)René 'Necoro' Neumann2-3/+3
2023-09-20Bump goreleaser/goreleaser-action from 4 to 5dependabot[bot]1-1/+1
2023-09-15Go 1.21René 'Necoro' Neumann2-8/+2
2023-09-15Upgrade dependenciesRené 'Necoro' Neumann2-17/+20
2023-09-15Bump github.com/antonmedv/expr from 1.14.0 to 1.15.1dependabot[bot]2-8/+4
2023-09-15Bump actions/checkout from 3 to 4dependabot[bot]2-2/+2
2023-08-26Bump golang.org/x/net from 0.12.0 to 0.14.0dependabot[bot]2-6/+6
2023-08-26Bump github.com/antonmedv/expr from 1.12.6 to 1.14.0dependabot[bot]2-3/+3
2023-07-15Upgrade depsRené 'Necoro' Neumann2-15/+12
2023-06-13Version Changelog entryv1.7.0René 'Necoro' Neumann1-1/+4
2023-06-13Prepare v1.7.0René 'Necoro' Neumann2-2/+2
2023-06-05Improve changelogRené 'Necoro' Neumann1-2/+4
2023-06-05IMAP client does not need to know about max number of connectionsRené 'Necoro' Neumann2-19/+12
2023-06-04ChangelogRené 'Necoro' Neumann1-0/+4
2023-06-04Add new config option to set max number of IMAP connections.René 'Necoro' Neumann5-20/+26
2023-06-04Improve locking around IMAP connect/disconnect.René 'Necoro' Neumann1-10/+26
2023-05-20Bump golang.org/x/net from 0.9.0 to 0.10.0dependabot[bot]2-2/+3
2023-05-12Amend changelogRené 'Necoro' Neumann1-0/+1
2023-05-12Issue #95 Add warning when config can be read globally.René 'Necoro' Neumann1-0/+11
2023-05-11Issue #95: Change cache ownership.René 'Necoro' Neumann1-0/+4
2023-05-11Issue #95: Add hint about sensible access rights.René 'Necoro' Neumann1-0/+1
2023-04-23[workflow] Port changes also to releaseRené 'Necoro' Neumann1-6/+5
2023-04-23[workflow] Checkout before go setupRené 'Necoro' Neumann1-3/+3
2023-04-23[workflow] determine go version from go.modRené 'Necoro' Neumann1-3/+2
2023-04-23Improve test to also validate error messageRené 'Necoro' Neumann1-42/+39
2023-04-22Fix/improve testsRené 'Necoro' Neumann1-59/+104
2023-04-22Improve error handlingRené 'Necoro' Neumann1-1/+11
2023-04-21Fix workflow: '1.20' needs to be quotedRené 'Necoro' Neumann2-2/+2