协作文本编辑器 [英] Collaborative Text Editor

查看:92
本文介绍了协作文本编辑器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑使用Twisted在Python中实现一个实时协作文本编辑器

。最初的计划是使用Twisted PB服务器守护程序,

接受用户:密码:来自文本编辑器客户端的文件连接,以使

更改为服务器上的指定文件,并让文本编辑器客户端

根据本地用户输入或输入更新其文件的本地副本

从其他用户输入,通过服务器中继。


Jabber的兼容性会很好,不同的用户的文本等颜色编码也是如此。但我真的希望尽可能保持这个简单。 />
a特定目的。 (我最近用扭曲的PB写的,非常好,因为它的功能和易用性很高兴。)


我很感激指向任何现有的,简单的基于Python的文本编辑器

适合于适应此目的。 "适合"指在OSI批准的许可证下的b
,并且干净利落,模块化地编写,以便于将b
纳入另一个项目。


提供合作我会感激地接受。结果(如果有的话)将是GPL'并且已经发布。如果有人想采取这些想法并使用他们自己的

项目运行,请成为我的客人。


谢谢,

Ed Suominen

I''m thinking of implementing a real-time collaborative text editor in Python
using Twisted. An initial plan is to use a Twisted PB server daemon that
accepts user:password:file connections from text editor clients to make
changes to a specified file on the server, and have the text editor clients
update their local copies of the file based on local user input or input
entered from other users, relayed via the server.

Jabber compatibility would be nice, as would color-coding of different
users'' text, etc. But I really want to keep this as simple as possible for
a specific purpose. (I''ve written with twisted PB recently and am very
pleased with its power and ease of use.)

I''d appreciate pointers to any existing, simple Python-based text editors
suitable for being adapted to this purpose. "Suitable" means under an
OSI-approved license and written cleanly and modularly to facilitate
incorporation into another project.

Offers to collaborate would be gratefully accepted. The result, if any, will
be GPL''d and released. If anyone wants to take these ideas and run with a
project of their own, be my guest.

Thanks,
Ed Suominen

推荐答案

>>>>> " ED" == Ed Suominen< ed *** @ spam-eepatents.com>写道:


Ed>我正在考虑实施一个实时协作文本

Ed>使用Twisted的Python编辑器。最初的计划是使用

Ed>扭曲的PB服务器守护进程


...


Ed> Jabber兼容性很好,

Ed>的颜色编码也是如此。不同的用户的文字等。但我真的想保持这个

Ed>尽可能简单


请查看Leo:

http://webpages.charter.net/edreamleo/front.html

不是因为潜力代码抢劫(许多似乎

使用scintilla, http:/ /www.scintilla.org/),但是因为它只是一个简洁的想法,并且会进一步增加Leo'的思绪:

品质: - )。


-

Ville Vainio http://tinyurl.com/2prnb
>>>>> "Ed" == Ed Suominen <ed***@spam-eepatents.com> writes:

Ed> I''m thinking of implementing a real-time collaborative text
Ed> editor in Python using Twisted. An initial plan is to use a
Ed> Twisted PB server daemon that

...

Ed> Jabber compatibility would be nice, as would color-coding of
Ed> different users'' text, etc. But I really want to keep this as
Ed> simple as possible for

Do check out Leo:

http://webpages.charter.net/edreamleo/front.html

Not so much because of the potential for code looting (many seem to
use scintilla for that, http://www.scintilla.org/), but because it
would just be a neat idea and would further augment Leo''s mind blowing
qualities :-).

--
Ville Vainio http://tinyurl.com/2prnb


Ed Suominen< ed *** @ spam-eepatents.com>写道:
Ed Suominen <ed***@spam-eepatents.com> writes:
我正在考虑使用Twisted实现Python中的实时协作文本编辑器。


很酷!我过去一直想知道这件事。不确定它会变得多么有用,但是找出它会很有趣。


初步计划是使用Twisted PB服务器守护进程
接受用户:密码:来自文本编辑器客户端的文件连接,以对服务器上的指定文件进行更改,并让文本编辑器客户端更新其文件的本地副本从其他用户输入的本地用户输入或输入,通过服务器中继。


我想知道客户端服务器是否可以到达这里。从表面上看,P2P

看起来更自然。


我一直想象它的工作方式如下。我确定

实验是找出哪些方法有效的方法,所以Twisted

听起来确实是一个好主意。


- 任何时候,只有一个人有控制权。


- 唯一能够移动光标并编辑文本的人就是那个人

有控制权。


- 任何人都可以标记他们想要控制。当发生这种情况时,每个人都会收到通知

.


- 控制权通过此人从一个人转移到另一个人

控制把它交给一个指定的人。

如果我这样做(我当然不是这样),我会用我的

方式来满足以下目标:


- 关键:在任何体面的编辑器上实施协议

的方式应该是开放的。


- 重要提示:协议应该是高效的,因此延迟最小化为b
。我想这需要推出更改而不是

轮询来检查更改,并且具有相当高级别的b $ b b原始操作 - 可能是插入,剪切,粘贴,移动,也许

矩形切割/粘贴操作,也许是缩进/ dedent,加上

在圆形剪贴板堆栈上的操作(奇怪的图像;-)。


Jabber的兼容性会很好,不同的用户''文字等的颜色编码也是不错的。


Jabber当然看起来完全是次要的:如果它有助于满足你的目标,那就太棒了。如果没有,谁在乎?


我不知道颜色编码是如何工作的,除了自上次输入

以来的文字控制开关有点颜色

不同。


[...]我很感激指向任何现有的,简单的基于Python的文本编辑器
适合于适应这一目的。 "适合"指在OSI批准的许可下,并以干净和模块化的方式编写,以便于并入另一个项目。
I''m thinking of implementing a real-time collaborative text editor in Python
using Twisted.
Cool! I''ve wondered about this in the past. Not sure how useful it
would turn out to be, but would be fun to find out.

An initial plan is to use a Twisted PB server daemon that
accepts user:password:file connections from text editor clients to make
changes to a specified file on the server, and have the text editor clients
update their local copies of the file based on local user input or input
entered from other users, relayed via the server.
I wonder if client-server is the way to go here. On the surface, P2P
seems more natural fit.

The way I''ve always imagined it working is as follows. I''m sure
experimentation is the way to find out what works, though, so Twisted
certainly sounds like a great idea.

- At any time, exactly one person has control.

- The only person able to move the cursor and edit text is the one
with control.

- Anybody may flag up that they want control. Everybody is notified
when this happens.

- Control passes from one person to another by means of the person
with control yielding it to a specified person.
If I were doing this (which I''m not, of course), I would go out of my
way to meet the following goals:

- Critical: the way should be left open to implementing the protocol
on any decent editor.

- Important: the protocol should be efficient, so that latency is
minimised. I imagine this requires pushing changes out rather than
polling to check for changes, and having reasonably high-level
primitive operations -- maybe insert, cut, paste, move, maybe
rectangle-wise cut/paste operations too, maybe indent / dedent, plus
operations on a circular clipboard stack (strange image ;-).

Jabber compatibility would be nice, as would color-coding of different
users'' text, etc.
Jabber certainly seems an entirely secondary thing: if it helps meet
your goals, great. If not, who cares?

I don''t see how colour coding would work, other than to have text that
has been entered since the last switch of control coloured
differently.

[...] I''d appreciate pointers to any existing, simple Python-based text editors
suitable for being adapted to this purpose. "Suitable" means under an
OSI-approved license and written cleanly and modularly to facilitate
incorporation into another project.



[...]


我知道vim是Python脚本的,并且拥有相当广泛的用户群

(特别是如果算上)。


我原本想要学习vi的理由很多,但是很难找到我的emacs习惯...


有 - 适当数量的乐趣你的朋友

John


[...]

I know vim is Python-scriptable, and has a fairly wide user base
(especially if you count).

For a number of reasons I''ve been meaning to learn vi properly for
ages, but find it very hard to kick my emacs habit...

have-the-appropriate-amount-of-fun-ly y''rs
John


2004年7月14日23:21:38 + 0100, jj*@pobox.com (John J. Lee)写道:
On 14 Jul 2004 23:21:38 +0100, jj*@pobox.com (John J. Lee) wrote:
Ed Suominen< ; ED *** @ spam-eepatents.com>写道:
Ed Suominen <ed***@spam-eepatents.com> writes:
我正在考虑使用Twisted实现Python中的实时协作文本编辑器。
酷!我过去一直想知道这件事。不确定它会变得多么有用,但找出它会很有趣。

I''m thinking of implementing a real-time collaborative text editor in Python
using Twisted.
Cool! I''ve wondered about this in the past. Not sure how useful it
would turn out to be, but would be fun to find out.

初步计划是使用Twisted PB服务器守护程序
接受用户:密码:来自文本编辑器客户端的文件连接,以对服务器上的指定文件进行更改,并让文本编辑器客户端更新其文件的本地副本从其他用户输入的本地用户输入或输入,通过服务器中继。
An initial plan is to use a Twisted PB server daemon that
accepts user:password:file connections from text editor clients to make
changes to a specified file on the server, and have the text editor clients
update their local copies of the file based on local user input or input
entered from other users, relayed via the server.



我想知道客户端服务器是否可以到达此处。从表面上看,P2P似乎更自然。

我一直想象它的工作方式如下。我确定实验是找出哪些方法有效的方法,所以Twisted
肯定听起来像个好主意。

- 在任何时候,只有一个人有控制权。



I wonder if client-server is the way to go here. On the surface, P2P
seems more natural fit.

The way I''ve always imagined it working is as follows. I''m sure
experimentation is the way to find out what works, though, so Twisted
certainly sounds like a great idea.

- At any time, exactly one person has control.



为什么不喜欢多人游戏,每个人都看到同一个世界

(带有其他玩家活动迹象的文件)和所有能够同时播放(选择要编辑的文本)(只是没有重叠文本)。
- 唯一能够移动光标和编辑文本的人就是那个<带控制的。
为什么?为什么不拥有两个窗口,一个具有共同的世界视图,其中

任何人都可以选择这样远未选择的文本 - 在选择上更改

外观并且可能有提示 - 信息浮动说谁的选择是,等等 -

和另一个窗口来编辑所选文本,这只会改变

编辑人员时的常见视图拯救了。保存和释放将

使文本再次被其他人选择。

- 任何人都可以标记他们想要控制。发生这种情况时,每个人都会收到通知。
见上文。他们只是做了一个选择,要么成功与否,按先到先得的原则按照


- 控制通过控制人员从一个人传递到另一个人
将它交给指定的人。
太麻烦了。此外,如果有人离开并忘记关闭他的会话,

应该有一个超时。也许一个选择应该有一个多长时间的条目,

它应该显示在提示中倒计时。


如果我这样做(这我当然不是,我会以自己的方式实现以下目标:

- 关键:实施协议的方式应该是开放的在任何体面的编辑器上。

- 重要:协议应该是高效的,以便最大限度地减少延迟。我想这需要推出更改而不是轮询以检查更改,并且具有相当高级别的原始操作 - 可能是插入,剪切,粘贴,移动,也许是矩形方式切割/粘贴操作,也许缩进/ dedent,加上
圆形剪贴板堆栈上的操作(奇怪的图像;-)。

我会问游戏人他们如何管理和缓存常见state。


Why not like a multiplayer game, where everyone sees the same world
(document with signs of other player''s activity) and all are able
to play (select text for editing) at the same time (just not on overlapping text).
- The only person able to move the cursor and edit text is the one
with control. Why? Why not have two windows, one with the common world view, where
anyone can select thus-far unselected text -- which on selection changes
appearance and may have hint-info floating to say whose selection is is, etc --
and the other window to edit the selected text, which would only change in
the common view when an editing person did a save. A save-and-release would
make the text selectable by others again.

- Anybody may flag up that they want control. Everybody is notified
when this happens. See above. They just do a selection, and either succeed or not, according
to first come first served.
- Control passes from one person to another by means of the person
with control yielding it to a specified person. Too bothersome. Also, if someone goes off and forgets to close his session,
there should be a timeout. Perhaps a selection should have a for-how-long entry,
and it should show counting down in the hint.


If I were doing this (which I''m not, of course), I would go out of my
way to meet the following goals:

- Critical: the way should be left open to implementing the protocol
on any decent editor.

- Important: the protocol should be efficient, so that latency is
minimised. I imagine this requires pushing changes out rather than
polling to check for changes, and having reasonably high-level
primitive operations -- maybe insert, cut, paste, move, maybe
rectangle-wise cut/paste operations too, maybe indent / dedent, plus
operations on a circular clipboard stack (strange image ;-).
I''d ask game people how they manage and cache common state.

Jabber兼容性很好,不同用户''文本的颜色编码等等。
Jabber compatibility would be nice, as would color-coding of different
users'' text, etc.


不排除类似游戏的方法。
Jabber肯定似乎是次要的事情:如果它有助于实现你的目标,那就太好了。如果没有,谁在乎呢?
能够与所有

活动区域的当前编辑器单独通信似乎很有用。
我不知道颜色编码是如何工作的,除了自上次控制色彩切换后输入
的文字不同。
我会使用一个轻微的背景颜色更改等来表示正在编辑的文本区域,

并使用提示或右键单击弹出窗口等,以获取更多详细信息和访问权限。

结构化文本(如xml等)中的选择可能会使用有用的约束,

或者可选地与原始文本一样。
[...]

Not excluded from game-like approach.
Jabber certainly seems an entirely secondary thing: if it helps meet
your goals, great. If not, who cares? Being able to communicate separately with the current editor of any of all the
active areas would seem useful.
I don''t see how colour coding would work, other than to have text that
has been entered since the last switch of control coloured
differently. I''d use one slight background color change or such to indicate a text area under edit,
and use hints or right-click popups or such for additional details and comm access.
Selection in structured text such as xml etc might operate with useful constraints,
or optionally as with raw text.
[...]

我非常感谢指向适合此目的的任何现有的,简单的基于Python的文本编辑器。 "适合"指OSI批准的许可证,并以干净和模块化的方式编写,以便于并入另一个项目。[...]
I''d appreciate pointers to any existing, simple Python-based text editors
suitable for being adapted to this purpose. "Suitable" means under an
OSI-approved license and written cleanly and modularly to facilitate
incorporation into another project.[...]



因为选择和共同状态查看将在一个单独的窗口中,

选择的结果可能是在本地获取临时文件进行编辑,

并且任何编辑器都应该能够处理。


保存和保存并释放函数可能需要一些专门的宏,

但我猜任何体面的编辑器都可以做到。或者可以在shell中包装编辑器

执行,注意文件更新和最终编辑器退出...

我知道vim是Python脚本化的,并且用户相当广泛基地
(特别是如果你算的话)。

由于种种原因,我一直有意为学习vi适合
年龄,但发现很难踢我的emacs的习惯...

有适当数量的乐趣你的朋友

John


Since selection and common-state viewing would be in a separate window,
the result of a selection could be getting a temp file locally for editing,
and any editor should be able to handle that.

The save and save-and-release functions might require some specialized macros,
but I''d guess any decent editor could be made to do it. Or maybe wrap editor
execution in a shell that notices file updates and the final editor exit...
I know vim is Python-scriptable, and has a fairly wide user base
(especially if you count).

For a number of reasons I''ve been meaning to learn vi properly for
ages, but find it very hard to kick my emacs habit...

have-the-appropriate-amount-of-fun-ly y''rs
John



只是OTTOMH ......


问候,

Bengt Richter


Just OTTOMH...

Regards,
Bengt Richter


这篇关于协作文本编辑器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆