oship-dev team mailing list archive
-
oship-dev team
-
Mailing list archive
-
Message #01978
[Branch ~oship-dev/oshippy/trunk] Rev 491: Removed outdated code and Eclipse project info.
------------------------------------------------------------
revno: 491
committer: Timothy W. Cook <timothywayne.cook@xxxxxxxxx>
branch nick: oshippy
timestamp: Sat 2012-06-09 22:20:43 -0300
message:
Removed outdated code and Eclipse project info.
removed:
.project
.pydevproject
.settings/
.settings/org.eclipse.core.resources.prefs
src/__init__.py
src/ccd/
src/ccd/__init__.py
src/common/
src/common/__init__.py
src/content/
src/content/__init__.py
src/datatypes/
src/datatypes/__init__.py
src/demographics/
src/demographics/__init__.py
src/metadata/
src/metadata/__init__.py
src/structures/
src/structures/__init__.py
--
lp:oshippy
https://code.launchpad.net/~oship-dev/oshippy/trunk
Your team OSHIP Development Team is subscribed to branch lp:oshippy.
To unsubscribe from this branch go to https://code.launchpad.net/~oship-dev/oshippy/trunk/+edit-subscription
=== removed file '.project'
--- .project 2011-12-07 14:31:12 +0000
+++ .project 1970-01-01 00:00:00 +0000
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.mlhim2.oshippy</name>
- <comment></comment>
- <projects>
- <project>org.mlhim2</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.python.pydev.PyDevBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.python.pydev.pythonNature</nature>
- </natures>
-</projectDescription>
=== removed file '.pydevproject'
--- .pydevproject 2011-12-07 14:31:12 +0000
+++ .pydevproject 1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?eclipse-pydev version="1.0"?>
-
-<pydev_project>
-<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Python 3.2</pydev_property>
-<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 3.0</pydev_property>
-<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
-<path>/org.mlhim2.oshippy/src</path>
-</pydev_pathproperty>
-</pydev_project>
=== removed directory '.settings'
=== removed file '.settings/org.eclipse.core.resources.prefs'
--- .settings/org.eclipse.core.resources.prefs 2011-12-07 14:31:12 +0000
+++ .settings/org.eclipse.core.resources.prefs 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
-#Wed Dec 07 08:25:17 CST 2011
-eclipse.preferences.version=1
-encoding//src/__init__.py=utf-8
-encoding//src/datatypes/__init__.py=utf-8
=== removed file 'src/__init__.py'
--- src/__init__.py 2011-12-07 14:28:30 +0000
+++ src/__init__.py 1970-01-01 00:00:00 +0000
@@ -1,11 +0,0 @@
-#-*- coding: utf-8 -*-
-# Copyright,2009-2011 Timothy W. Cook & Contributors
-# See the accompanying LICENSE.txt for use and distribution guidelines.
-
-import ccd
-import common
-import content
-import datatypes
-import demographics
-import metadata
-import structures
=== removed directory 'src/ccd'
=== removed file 'src/ccd/__init__.py'
=== removed directory 'src/common'
=== removed file 'src/common/__init__.py'
=== removed directory 'src/content'
=== removed file 'src/content/__init__.py'
=== removed directory 'src/datatypes'
=== removed file 'src/datatypes/__init__.py'
--- src/datatypes/__init__.py 2011-12-07 14:28:30 +0000
+++ src/datatypes/__init__.py 1970-01-01 00:00:00 +0000
@@ -1,253 +0,0 @@
-#-*- coding: utf-8 -*-
-# Copyright,2009-2011 Timothy W. Cook & Contributors
-# See the accompanying LICENSE.txt for use and distribution guidelines.
-
-from abc import ABCMeta
-from datetime import datetime
-from collections import Iterable
-import re
-
-class DvAny(metaclass=ABCMeta):
- "Base abstract class for all datatypes."
- ev = None
- valid_time_begin = None
- valid_time_end = None
-
- def check_begin(self):
- if self.valid_time_begin:
- if not isinstance(self.valid_time_begin, datetime):
- raise TypeError("valid_time_begin is not a valid datetime")
-
- def check_end(self):
- if self.valid_time_end:
- if isinstance(self.valid_time_end, datetime):
- if not self.valid_time_begin <= self.valid_time_end:
- raise ValueError("begin time must be prior to end time.")
- else:
- raise TypeError("valid_time_end is not a valid datetime")
-
-class DvBoolean(DvAny):
- """
- Items which are truly boolean data, such as true/false or yes/no answers.
- Use for such data, it is important to devise the meanings (usually questions in subjective data) carefully, so that the only allowed results are
- in fact true or false.
- Potential MisUse: The DvBoolean class should not be used as a replacement for naively modelled enumerated types such as male/female etc.
- Such values should be coded, and in any case the enumeration often has more than two values.
- Though the DvBoolean.dv attribute is a String type this is to easily allow responses that the user is more familiar with using in the context
- such as 'Yes', 'No' or 'True', 'False'. A conversion method is required to convert the valid_trues to True and the valid_falses to False.
- """
-
- def __init__(self, dv, valid_trues=('T', 't', 'True', 'TRUE', 'true', 1), valid_falses=('F', 'f', 'False', 'FALSE', 'false', 0)):
- self.dv = dv
- self.valid_trues = valid_trues
- self.valid_falses = valid_falses
-
- def validate(self):
- "Validate that the value is in the true or false list and determine the return value."
- if self.dv in self.valid_trues:
- return True
- elif self.dv in self.valid_falses:
- return False
- else:
- raise ValueError("The boolean dv attribute is not a valid True or False value.")
-
-class DvString(DvAny):
- """
- The string data type can contain characters, line feeds, carriage returns, and tab characters.
- """
-
- def __init__(self, dv, whitespace='preserve', language=None, uuid=None, enumeration=None, pattern=None, length=None, min_length=None, max_length=None):
- """
- dv- the actual string data value.
-
- language - Optional indicator of the localised language in which the value is written.
- Coded IAW IETF RFC 5646. http://tools.ietf.org/html/rfc5646 language tag information
- should be used from the IANA registry http://www.iana.org/assignments/
- language-subtag-registry Only used when the text object is in a different language
- from the enclosing CCD.
-
- uuid - A string as a valid UUID. Primarily used as a key in order to track translations.
-
- enumeration - To limit the content of the DvString.dv attribute to one of a set of acceptable values, use the enumeration constraint.
-
- pattern - A Regular Expression as defined by the XML standards.
- See http://www.regular-expressions.info/xml.html
-
- whitespace - Options are:
- preserve - means that the processor WILL NOT remove any white space characters
- replace - means that the processor WILL REPLACE all white space characters (line feeds, tabs, spaces, and carriage returns) with spaces
- collapse - means that the processor WILL REMOVE all white space characters (line feeds, tabs, spaces, carriage returns are replaced with spaces, leading and trailing spaces are removed, and multiple spaces are reduced to a single space)
-
- length - Enter a positive integer for a specific length string as the dv.
- Note that if this is non-zero then max_length and min_length will be ignored.
-
- min_length - A positive integer as the minimum length of the dv attribute.
-
- max_length - A positive integer as the maximum length of the dv attribute.
- """
- if dv and isinstance(dv, str): self.dv = dv
- if whitespace.lower() in ('preserve', 'replace', 'collapse'): self.whitespace = whitespace.lower()
- else: raise ValueError('invalid whitespace parameter')
-
- if language: self.language = language
- if uuid and isinstance(uuid, str): self.uuid = uuid
- if enumeration and isinstance(enumeration, Iterable): self.enumeration = enumeration
- if pattern and isinstance(pattern, str): self.pattern = pattern
- if length and isinstance(length, int) and length > 0: self.length = length
- if min_length and isinstance(min_length, int) and min_length > 0: self.min_length = min_length
- if max_length and isinstance(max_length, int) and max_length > 0: self.max_length = max_length
-
- def validate(self):
- "validate all the string parameters"
- valid = True
- if self.length:
- if self.dv.len() != self.length:
- valid = False
- raise ValueError('The string is not exactly ' + str(self.length) + 'characters long.')
-
- if valid and self.min_length and self.dv.len() > self.min_length:
- valid = False
- raise ValueError('The minimum string length is ' + str(self.min_length))
-
- if valid and self.max_length and self.dv.len() < self.max_length:
- valid = False
- raise ValueError('The maximum string length is ' + str(self.max_length))
-
- if valid and self.enumeration and self.dv not in self.enumeration:
- raise ValueError('The string is not a valid entry from the enumeration.')
- valid = False
-
- if valid and self.pattern and re.compile(self.pattern).match(self.dv):
- pass
- else:
- raise ValueError('The string does not match the pattern provided.')
- valid = False
-
- if valid and self.whitespace == 'preserve':
- pass
- elif valid and self.whitespace == 'collapse':
- self.dv = ' '.join(self.dv.split())
- elif valid and self.whitespace == 'replace' and not self.dv.isprintable():
- self.dv = self.dv('\n', ' ')
- self.dv = self.dv('\t', ' ')
- self.dv = self.dv('\r', ' ')
-
- return valid
-
-class DvURI(DvString):
- """
- Used to specify a URI. Set the pattern to accommodate your needs.
- """
-
- def __init__(self, dv, enumeration=None, pattern=None):
- if dv and isinstance(dv, str): self.dv = ' '.join(self.dv.split())
- else: return None
- self.whitespace = 'collapse'
- self.language = None
- self.uuid = None
- self.enumeration = enumeration
- self.pattern = pattern
- self.length = None
- self.min_length = None
- self.max_length = None
-
-class DvNormalizedString(DvString):
- """
- Derived from the String data type.
- The normalizedString data type also contains characters, but all line feeds, carriage returns, and tab characters are removed.
- """
-
- def __init__(self, dv, language=None, uuid=None, enumeration=None, pattern=None, length=None, min_length=None, max_length=None):
- if dv and isinstance(dv, str): self.dv = ' '.join(self.dv.split())
- else: return None
- self.whitespace = 'collapse'
- if language: self.language = language
- if uuid and isinstance(uuid, str): self.uuid = uuid
- if enumeration and isinstance(enumeration, Iterable): self.enumeration = enumeration
- if pattern and isinstance(pattern, str): self.pattern = pattern
- if length and isinstance(length, int) and length > 0: self.length = length
- if min_length and isinstance(min_length, int) and min_length > 0: self.min_length = min_length
- if max_length and isinstance(max_length, int) and max_length > 0: self.max_length = max_length
-
-
-class DvToken(DvString):
- """
- Derived from the String data type.
- The token data type also contains characters, but the line feeds, carriage returns, tabs, leading and trailing spaces are removed,
- and multiple spaces are replaced with one space.
- """
-
- def __init__(self, dv, language=None, uuid=None, enumeration=None, pattern=None, length=None, min_length=None, max_length=None):
- if dv and isinstance(dv, str): self.dv = ' '.join(self.dv.split())
- else: return None
- self.whitespace = 'collapse'
- if language: self.language = language
- if uuid and isinstance(uuid, str): self.uuid = uuid
- if enumeration and isinstance(enumeration, Iterable): self.enumeration = enumeration
- if pattern and isinstance(pattern, str): self.pattern = pattern
- if length and isinstance(length, int) and length > 0: self.length = length
- if min_length and isinstance(min_length, int) and min_length > 0: self.min_length = min_length
- if max_length and isinstance(max_length, int) and max_length > 0: self.max_length = max_length
-
-
-class DvCodedString(DvString):
- """
- A text item whose dv attribute must be the long name or description from a controlled terminology,
- the key (i.e. the 'code') of which is the code_string attribute.
- """
- def __init__(self, dv, language=None, uuid=None, enumeration=None, pattern=None, length=None, min_length=None, max_length=None):
- if dv and isinstance(dv, str): self.dv = ' '.join(self.dv.split())
- else: return None
- self.whitespace = 'collapse'
- if language: self.language = language
- if uuid and isinstance(uuid, str): self.uuid = uuid
- if enumeration and isinstance(enumeration, Iterable): self.enumeration = enumeration
- if pattern and isinstance(pattern, str): self.pattern = pattern
- if length and isinstance(length, int) and length > 0: self.length = length
- if min_length and isinstance(min_length, int) and min_length > 0: self.min_length = min_length
- if max_length and isinstance(max_length, int) and max_length > 0: self.max_length = max_length
-
-
-class DvIdentifier(DvString):
- """
- Type for representing identifiers of real-world entities. Typical identifiers include: drivers licence number, social security number,
- veterans affairs number, prescription id, order id, system id and so on.
- """
- def __init__(self, dv, language=None, uuid=None, enumeration=None, pattern=None, length=None, min_length=None, max_length=None):
- if dv and isinstance(dv, str): self.dv = ' '.join(self.dv.split())
- else: return None
- self.whitespace = 'collapse'
- if language: self.language = language
- if uuid and isinstance(uuid, str): self.uuid = uuid
- if enumeration and isinstance(enumeration, Iterable): self.enumeration = enumeration
- if pattern and isinstance(pattern, str): self.pattern = pattern
- if length and isinstance(length, int) and length > 0: self.length = length
- if min_length and isinstance(min_length, int) and min_length > 0: self.min_length = min_length
- if max_length and isinstance(max_length, int) and max_length > 0: self.max_length = max_length
-
-
-class DvParagraph(DvAny):
- """
- A logical composite text value consisting of a series (a list) of DvStrings, i.e. plain or coded text to form a larger
- tract of prose, which may be interpreted for display purposes as a paragraph. DvParagraph is the standard way
- for constructing longer text items in summaries, reports and so on.
- """
- def __init__(self, items):
- if isinstance(items, list):
- for i in items:
- if not isinstance(i, DvString):
- raise ValueError('A non-DvString was found in the DvPAragraph.items attribute.')
-
- self.items = items
-
-class DvEncapsulated(metaclass=ABCMeta, DvAny):
- """
- Abstract class defining the common meta-data of all types of encapsulated data.
- """
-
-
-
-
-
-
-
=== removed directory 'src/demographics'
=== removed file 'src/demographics/__init__.py'
=== removed directory 'src/metadata'
=== removed file 'src/metadata/__init__.py'
=== removed directory 'src/structures'
=== removed file 'src/structures/__init__.py'