Permalink
Browse files

2012/01/25 v4.24

Added missing setup.py
  • Loading branch information...
1 parent 530a444 commit 1e2b50b6e9fd07eeca23a60b91f3da8bd55d24bf @njr0 committed Feb 1, 2012
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -6,8 +6,8 @@ A Brief Overview of Fluidinfo
Fluidinfo is a simple, shared, online storage system in which each there are a set of objects, each of which can optionally be *about* something, and information is stored by tagging objects. Tags belong to users, and have names. Tags may store information simply by being present or absent, or they may have values. Thus I can indicate that I have read a book by attaching a tag called ``have-read`` to the object corresponding to that book, or I can rate it by attaching a ``rating`` tag with a numeric value to the object. Tag owners can set permissions on their tags to control who can see them and who can alter/use them. So tags are owned and are subject to a permissions system and policies, while all objects are shared.
-Overview of the Command Line
-----------------------------
+Overview of the Fish Command Line
+---------------------------------
The Fish command line normally acts as a sort-of one-shot command shell for Fluidinfo. It gives access to much of the functionality of the underlying ``fishlib.py`` library, with a main focus on tagging, getting tag values, finding tags, querying Fluidinfo and clearing (removing tags). It also has some facilities for listing tags and viewing and altering their permissions.
@@ -3,8 +3,8 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
-The Fish Command Line for Fluidinfo
-===================================
+Fish — The Fluidinfo Shell
+==========================
**Overview**
@@ -27,7 +27,7 @@
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="fish 4.33 documentation" href="index.html" />
<link rel="next" title="Shell-Fish: The Online version of Fish" href="shell-fish.html" />
- <link rel="prev" title="The Fish Command Line for Fluidinfo" href="index.html" />
+ <link rel="prev" title="Fish: The Fluidinfo Shell" href="index.html" />
</head>
<body>
<div class="related">
@@ -40,7 +40,7 @@
<a href="shell-fish.html" title="Shell-Fish: The Online version of Fish"
accesskey="N">next</a> |</li>
<li class="right" >
- <a href="index.html" title="The Fish Command Line for Fluidinfo"
+ <a href="index.html" title="Fish: The Fluidinfo Shell"
accesskey="P">previous</a> |</li>
<li><a href="index.html">fish 4.33 documentation</a> &raquo;</li>
</ul>
@@ -57,8 +57,8 @@
<h2>A Brief Overview of Fluidinfo<a class="headerlink" href="#a-brief-overview-of-fluidinfo" title="Permalink to this headline">¶</a></h2>
<p>Fluidinfo is a simple, shared, online storage system in which each there are a set of objects, each of which can optionally be <em>about</em> something, and information is stored by tagging objects. Tags belong to users, and have names. Tags may store information simply by being present or absent, or they may have values. Thus I can indicate that I have read a book by attaching a tag called <tt class="docutils literal"><span class="pre">have-read</span></tt> to the object corresponding to that book, or I can rate it by attaching a <tt class="docutils literal"><span class="pre">rating</span></tt> tag with a numeric value to the object. Tag owners can set permissions on their tags to control who can see them and who can alter/use them. So tags are owned and are subject to a permissions system and policies, while all objects are shared.</p>
</div>
-<div class="section" id="overview-of-the-command-line">
-<h2>Overview of the Command Line<a class="headerlink" href="#overview-of-the-command-line" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="overview-of-the-fish-command-line">
+<h2>Overview of the Fish Command Line<a class="headerlink" href="#overview-of-the-fish-command-line" title="Permalink to this headline">¶</a></h2>
<p>The Fish command line normally acts as a sort-of one-shot command shell for Fluidinfo. It gives access to much of the functionality of the underlying <tt class="docutils literal"><span class="pre">fishlib.py</span></tt> library, with a main focus on tagging, getting tag values, finding tags, querying Fluidinfo and clearing (removing tags). It also has some facilities for listing tags and viewing and altering their permissions.</p>
<p>Assuming you have installed <tt class="docutils literal"><span class="pre">fish.py</span></tt>, set up a credentials file, and created an alias <tt class="docutils literal"><span class="pre">fish</span></tt> to run it, basic use is exemplified as follows. In the examples that follow, I assume that the Fluidinfo user has username <tt class="docutils literal"><span class="pre">alice</span></tt>. All tags belonging to alice start <tt class="docutils literal"><span class="pre">alice/</span></tt>.</p>
<blockquote>
@@ -243,7 +243,7 @@
<ul>
<li><a class="reference internal" href="#">An Overview of the Fish Command Line for Fluidinfo</a><ul>
<li><a class="reference internal" href="#a-brief-overview-of-fluidinfo">A Brief Overview of Fluidinfo</a></li>
-<li><a class="reference internal" href="#overview-of-the-command-line">Overview of the Command Line</a></li>
+<li><a class="reference internal" href="#overview-of-the-fish-command-line">Overview of the Fish Command Line</a></li>
<li><a class="reference internal" href="#the-anatomy-of-the-core-fish-commands">The Anatomy of the core Fish Commands</a></li>
<li><a class="reference internal" href="#invoking-fish-as-a-shell">Invoking Fish as a Shell</a></li>
</ul>
@@ -252,7 +252,7 @@
<h4>Previous topic</h4>
<p class="topless"><a href="index.html"
- title="previous chapter">The Fish Command Line for Fluidinfo</a></p>
+ title="previous chapter">Fish: The Fluidinfo Shell</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="shell-fish.html"
title="next chapter">Shell-Fish: The Online version of Fish</a></p>
@@ -288,7 +288,7 @@
<a href="shell-fish.html" title="Shell-Fish: The Online version of Fish"
>next</a> |</li>
<li class="right" >
- <a href="index.html" title="The Fish Command Line for Fluidinfo"
+ <a href="index.html" title="Fish: The Fluidinfo Shell"
>previous</a> |</li>
<li><a href="index.html">fish 4.33 documentation</a> &raquo;</li>
</ul>
@@ -8,7 +8,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>The Fish Command Line for Fluidinfo &mdash; fish 4.33 documentation</title>
+ <title>Fish — The Fluidinfo Shell &mdash; fish 4.33 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@@ -47,8 +47,8 @@
<div class="bodywrapper">
<div class="body">
- <div class="section" id="the-fish-command-line-for-fluidinfo">
-<h1>The Fish Command Line for Fluidinfo<a class="headerlink" href="#the-fish-command-line-for-fluidinfo" title="Permalink to this headline">¶</a></h1>
+ <div class="section" id="fish-the-fluidinfo-shell">
+<h1>Fish — The Fluidinfo Shell<a class="headerlink" href="#fish-the-fluidinfo-shell" title="Permalink to this headline">¶</a></h1>
<p><strong>Overview</strong></p>
<div class="toctree-wrapper compound">
<ul>
Oops, something went wrong.
@@ -19,8 +19,8 @@ So tags are owned and are subject to a permissions system and
policies, while all objects are shared.
-Overview of the Command Line
-============================
+Overview of the Fish Command Line
+=================================
The Fish command line normally acts as a sort-of one-shot command
shell for Fluidinfo. It gives access to much of the functionality of
@@ -1,6 +1,6 @@
-The Fish Command Line for Fluidinfo
-***********************************
+Fish — The Fluidinfo Shell
+**************************
**Overview**
View
@@ -6,8 +6,8 @@ A Brief Overview of Fluidinfo
Fluidinfo is a simple, shared, online storage system in which each there are a set of objects, each of which can optionally be *about* something, and information is stored by tagging objects. Tags belong to users, and have names. Tags may store information simply by being present or absent, or they may have values. Thus I can indicate that I have read a book by attaching a tag called ``have-read`` to the object corresponding to that book, or I can rate it by attaching a ``rating`` tag with a numeric value to the object. Tag owners can set permissions on their tags to control who can see them and who can alter/use them. So tags are owned and are subject to a permissions system and policies, while all objects are shared.
-Overview of the Command Line
-----------------------------
+Overview of the Fish Command Line
+---------------------------------
The Fish command line normally acts as a sort-of one-shot command shell for Fluidinfo. It gives access to much of the functionality of the underlying ``fishlib.py`` library, with a main focus on tagging, getting tag values, finding tags, querying Fluidinfo and clearing (removing tags). It also has some facilities for listing tags and viewing and altering their permissions.
@@ -3,8 +3,8 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
-The Fish Command Line for Fluidinfo
-===================================
+Fish — The Fluidinfo Shell
+==========================
**Overview**
View
@@ -587,5 +587,7 @@
Localised imports.
Was getting all ready to push fish to pypi, but there's already a fish there.
+2012/01/25 v4.24
+Added missing setup.py
"""
View
@@ -6,7 +6,7 @@
# in the AUTHOR
# Licence terms in LICENCE.
-__version__ = u'4.33'
+__version__ = u'4.34'
VERSION = __version__
import codecs
@@ -18,6 +18,7 @@
import urllib
from functools import wraps
try:
+ assert '/no/requests' not in sys.path
import requests
if requests.__version__ >= '1.0.0':
raise ImportError
@@ -873,7 +874,7 @@ def get_object_tags(self, spec, byAbout):
result = json.loads(value)
return result[u'tagPaths']
else:
- raise ObjectNotFoundError(u'Couldn\'t find object %s' % obj)
+ raise ObjectNotFoundError(u'Couldn\'t find object %s' % byAbout)
def get_object_tags_by_id(self, id):
return self.get_object_tags(id, False)
View
@@ -2,17 +2,29 @@
def tag_by_about_values(db, items, map=None):
# takes items as a list, tuple or dictionary of objects
+ body = tag_by_about_values_json(db, items, map)
+ return db.call('PUT', '/values', json.dumps(body))
+
+
+def save_json_for_tag_by_about_values(db, items, path, map=None):
+ body = tag_by_about_values_json(db, items, map)
+ f = open(path, 'w')
+ import pprint
+ for item in items:
+ pprint.pprint(item)
+ f.write(json.dumps(body))
+ f.close()
+
+
+def tag_by_about_values_json(db, items, map):
objs = items.values if type(items) == dict else items
- body = {u'queries' : [ [u'fluiddb/about = "%s"' % o.about,
- dict((u'%s/%s' % (db.credentials.username,
- k.replace('_', '/')),
- {u'value': o.__dict__[k]})
- for k in o.__dict__
- if (k != u'about' and not k.startswith(u'_')))]
- for o in items]}
-# print json.dumps(body)
- o = db.call('PUT', '/values', json.dumps(body))
- return o
+ return {u'queries' : [ [u'fluiddb/about = "%s"' % o.about,
+ dict((u'%s/%s' % (db.credentials.username,
+ k.replace('_', '/')),
+ {u'value': o.__dict__[k]})
+ for k in o.__dict__
+ if (k != u'about' and not k.startswith(u'_')))]
+ for o in items]}
View
@@ -0,0 +1,60 @@
+# -*- coding: utf-8 -*-
+from distutils.core import setup
+
+setup(name='fish',
+ version='4.34',
+ description='The Fluidinfo Shell',
+ author='Nicholas J. Radcliffe',
+ author_email='njr@StochasticSolutions.com',
+ packages=['fish'],
+ url="http://github.com/njr0/fish/",
+ download_url="https://github.com/njr0/fish",
+ scripts=['scripts/fish'],
+ keywords=[
+ 'fluidinfo',
+ 'fluiddb',
+ 'abouttag',
+ 'about',
+ 'tag',
+ 'shell',
+ 'normalization',
+ 'canonicalization',
+ 'standardarization'
+ ],
+ classifiers = [
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 2',
+ 'Development Status :: 5 - Production/Stable',
+ 'License :: OSI Approved :: MIT License',
+ 'Environment :: Other Environment',
+ 'Intended Audience :: Developers',
+ 'Topic :: Software Development :: Libraries :: Python Modules',
+ 'Topic :: Internet',
+ ],
+ install_requires = ['urlnorm>=1.1.2', 'requests==0.9.2'],
+ long_description = '''\
+The Fluidinfo shell provides a shell for Fluidinfo, modelled
+fairly closely on a Unix shell.
+
+Fluidinfo is a hosted, online database based on the notion of tagging.
+For more information on FluidDB, visit http://fluidinfo.com.
+
+The full documentation is hosted in Fluidinfo and may be accessed
+in an ordinary browser at
+
+ http://fluiddb.fluidinfo.com/about/fish/fish/index.html
+
+
+
+INSTALLATION
+
+ python setup.py install
+
+DEPENDENCIES
+
+ urlnorm
+ abouttag
+ requests (or httplib2)
+'''
+
+ )

0 comments on commit 1e2b50b

Please sign in to comment.