Mercurial > traipse
comparison upmana/mercurial/statichttprepo.py @ 28:ff154cf3350c ornery-orc
Traipse 'OpenRPG' {100203-00}
Traipse is a distribution of OpenRPG that is designed to be easy to
setup and go. Traipse also makes it easy for developers to work on code
without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy'
and adds fixes to the code. 'Ornery-Orc's main goal is to offer more
advanced features and enhance the productivity of the user.
Update Summary (Stable)
New Features:
New Bookmarks Feature
New 'boot' command to remote admin
New confirmation window for sent nodes
Miniatures Layer pop up box allows users to turn off Mini labels, from
FlexiRPG
New Zoom Mouse plugin added
New Images added to Plugin UI
Switching to Element Tree
New Map efficiency, from FlexiRPG
New Status Bar to Update Manager
New TrueDebug Class in orpg_log (See documentation for usage)
New Portable Mercurial
New Tip of the Day, from Core and community
New Reference Syntax added for custom PC sheets
New Child Reference for gametree
New Parent Reference for gametree
New Gametree Recursion method, mapping, context sensitivity, and
effeciency..
New Features node with bonus nodes and Node Referencing help added
New Dieroller structure from Core
New DieRoller portability for odd Dice
New 7th Sea die roller; ie [7k3] = [7d10.takeHighest(3).open(10)]
New 'Mythos' System die roller added
New vs. die roller method for WoD; ie [3v3] = [3d10.vs(3)]. Included for
Mythos roller also
New Warhammer FRPG Die Roller (Special thanks to Puu-san for the
support)
New EZ_Tree Reference system. Push a button, Traipse the tree, get a
reference (Beta!)
New Grids act more like Spreadsheets in Use mode, with Auto Calc
Fixes:
Fix to allow for portability to an OpenSUSE linux OS
Fix to mplay_client for Fedora and OpenSUSE
Fix to Text based Server
Fix to Remote Admin Commands
Fix to Pretty Print, from Core
Fix to Splitter Nodes not being created
Fix to massive amounts of images loading, from Core
Fix to Map from gametree not showing to all clients
Fix to gametree about menus
Fix to Password Manager check on startup
Fix to PC Sheets from tool nodes. They now use the tabber_panel
Fix to Whiteboard ID to prevent random line or text deleting.
Fixes to Server, Remote Server, and Server GUI
Fix to Update Manager; cleaner clode for saved repositories
Fixes made to Settings Panel and now reactive settings when Ok is
pressed
Fixes to Alternity roller's attack roll. Uses a simple Tuple instead of
a Splice
Fix to Use panel of Forms and Tabbers. Now longer enters design mode
Fix made Image Fetching. New fetching image and new failed image
Fix to whiteboard ID's to prevent non updated clients from ruining the
fix.
default_manifest.xml renamed to default_upmana.xml
author | sirebral |
---|---|
date | Wed, 03 Feb 2010 22:16:49 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
27:51428d30c59e | 28:ff154cf3350c |
---|---|
1 # statichttprepo.py - simple http repository class for mercurial | |
2 # | |
3 # This provides read-only repo access to repositories exported via static http | |
4 # | |
5 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> | |
6 # | |
7 # This software may be used and distributed according to the terms of the | |
8 # GNU General Public License version 2, incorporated herein by reference. | |
9 | |
10 from i18n import _ | |
11 import changelog, byterange, url, error | |
12 import localrepo, manifest, util, store | |
13 import urllib, urllib2, errno | |
14 | |
15 class httprangereader(object): | |
16 def __init__(self, url, opener): | |
17 # we assume opener has HTTPRangeHandler | |
18 self.url = url | |
19 self.pos = 0 | |
20 self.opener = opener | |
21 def seek(self, pos): | |
22 self.pos = pos | |
23 def read(self, bytes=None): | |
24 req = urllib2.Request(self.url) | |
25 end = '' | |
26 if bytes: | |
27 end = self.pos + bytes - 1 | |
28 req.add_header('Range', 'bytes=%d-%s' % (self.pos, end)) | |
29 | |
30 try: | |
31 f = self.opener.open(req) | |
32 data = f.read() | |
33 if hasattr(f, 'getcode'): | |
34 # python 2.6+ | |
35 code = f.getcode() | |
36 elif hasattr(f, 'code'): | |
37 # undocumented attribute, seems to be set in 2.4 and 2.5 | |
38 code = f.code | |
39 else: | |
40 # Don't know how to check, hope for the best. | |
41 code = 206 | |
42 except urllib2.HTTPError, inst: | |
43 num = inst.code == 404 and errno.ENOENT or None | |
44 raise IOError(num, inst) | |
45 except urllib2.URLError, inst: | |
46 raise IOError(None, inst.reason[1]) | |
47 | |
48 if code == 200: | |
49 # HTTPRangeHandler does nothing if remote does not support | |
50 # Range headers and returns the full entity. Let's slice it. | |
51 if bytes: | |
52 data = data[self.pos:self.pos + bytes] | |
53 else: | |
54 data = data[self.pos:] | |
55 elif bytes: | |
56 data = data[:bytes] | |
57 self.pos += len(data) | |
58 return data | |
59 | |
60 def build_opener(ui, authinfo): | |
61 # urllib cannot handle URLs with embedded user or passwd | |
62 urlopener = url.opener(ui, authinfo) | |
63 urlopener.add_handler(byterange.HTTPRangeHandler()) | |
64 | |
65 def opener(base): | |
66 """return a function that opens files over http""" | |
67 p = base | |
68 def o(path, mode="r"): | |
69 f = "/".join((p, urllib.quote(path))) | |
70 return httprangereader(f, urlopener) | |
71 return o | |
72 | |
73 return opener | |
74 | |
75 class statichttprepository(localrepo.localrepository): | |
76 def __init__(self, ui, path): | |
77 self._url = path | |
78 self.ui = ui | |
79 | |
80 self.path, authinfo = url.getauthinfo(path.rstrip('/') + "/.hg") | |
81 | |
82 opener = build_opener(ui, authinfo) | |
83 self.opener = opener(self.path) | |
84 | |
85 # find requirements | |
86 try: | |
87 requirements = self.opener("requires").read().splitlines() | |
88 except IOError, inst: | |
89 if inst.errno != errno.ENOENT: | |
90 raise | |
91 # check if it is a non-empty old-style repository | |
92 try: | |
93 self.opener("00changelog.i").read(1) | |
94 except IOError, inst: | |
95 if inst.errno != errno.ENOENT: | |
96 raise | |
97 # we do not care about empty old-style repositories here | |
98 msg = _("'%s' does not appear to be an hg repository") % path | |
99 raise error.RepoError(msg) | |
100 requirements = [] | |
101 | |
102 # check them | |
103 for r in requirements: | |
104 if r not in self.supported: | |
105 raise error.RepoError(_("requirement '%s' not supported") % r) | |
106 | |
107 # setup store | |
108 def pjoin(a, b): | |
109 return a + '/' + b | |
110 self.store = store.store(requirements, self.path, opener, pjoin) | |
111 self.spath = self.store.path | |
112 self.sopener = self.store.opener | |
113 self.sjoin = self.store.join | |
114 | |
115 self.manifest = manifest.manifest(self.sopener) | |
116 self.changelog = changelog.changelog(self.sopener) | |
117 self.tagscache = None | |
118 self.nodetagscache = None | |
119 self.encodepats = None | |
120 self.decodepats = None | |
121 | |
122 def url(self): | |
123 return self._url | |
124 | |
125 def local(self): | |
126 return False | |
127 | |
128 def lock(self, wait=True): | |
129 raise util.Abort(_('cannot lock static-http repository')) | |
130 | |
131 def instance(ui, path, create): | |
132 if create: | |
133 raise util.Abort(_('cannot create new static-http repository')) | |
134 return statichttprepository(ui, path[7:]) |