473,756 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Collaborative Text Editor

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:f ile 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
Jul 18 '05 #1
11 3549
>>>>> "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
Jul 18 '05 #2
Ed Suominen <ed***@spam-eepatents.com> writes:
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:f ile 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.

[...]

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
Jul 18 '05 #3
On 14 Jul 2004 23:21:38 +0100, jj*@pobox.com (John J. Lee) wrote:
Ed Suominen <ed***@spam-eepatents.com> writes:
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:f ile 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
experimentatio n 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.

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 compatibility would be nice, as would color-coding of different
users' text, etc.
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.
[...]
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.[...]

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

Just OTTOMH...

Regards,
Bengt Richter
Jul 18 '05 #4
John J. Lee wrote:
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.

[snip other ideas]

There are already editors that support such things, so imagining
how it works, while interesting, might not be the best approach
to get started... vim, for example, already can do this sort
of thing. I'm certain there are others out there.

-Peter
Jul 18 '05 #5
> 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:f ile 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.


Also take a look at SubEthaEdit:

http://www.codingmonkeys.de/subethaedit/index.html
Jul 18 '05 #6
jj*@pobox.com (John J. Lee) writes:
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.
See SubEthaEdit (Mac OS X only, unfortunately) for a very nice
implementation of this idea.
I wonder if client-server is the way to go here. On the surface, P2P
seems more natural fit.
I think client-server is the way to go, it reduces complexity when you
have more than two people collaborating at once. The person who
initiates the edit session has the cannonical version of the file.
- At any time, exactly one person has control.


SubEthaEdit allows all participants to write at the same time. Text
from each participant is marked with a highlight color specific to
that contributor.

Token-passing is an interesting idea, but it could be frustrating for
people who do not get the token (which could happen for any number of
reasons, deserved or undeserved).

Nick

--
# sigmask || 0.2 || 20030107 || public domain || feed this to a python
print reduce(lambda x,y:x+chr(ord(y )-1),' Ojdl!Wbshjti!=o bwAcboefstobudi/psh?')
Jul 18 '05 #7
Nicola Larosa on the twisted-python mailing list pointed me to a very
helpful link:
Are you aware of LeoN?
http://ryalias.freezope.org/souvenirs/leon

Leo (without 'N') is an outlining editor written in Python, old and
powerful, and LeoN is an extension for collaborative editing based on
Twisted, new and alpha, but probably worth a look.
Ed Suominen wrote:
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:f ile 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


Jul 18 '05 #8
Nick Vargish <na*******@band ersnatch.org> writes:
jj*@pobox.com (John J. Lee) writes:
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.


See SubEthaEdit (Mac OS X only, unfortunately) for a very nice
implementation of this idea.


There is also something called Hydra.

(And make-frame-on-display in Emacs, can be used for the same sort of
thing.)

Jul 18 '05 #9
Peter Hansen <pe***@engcorp. com> writes:
John J. Lee wrote:
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.

[snip other ideas]

There are already editors that support such things, so imagining
how it works, while interesting, might not be the best approach
to get started... vim, for example, already can do this sort
of thing. I'm certain there are others out there.


Could you provide a link to any info on how to do this in vim?
John
Jul 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
1931
by: Michele Simionato | last post by:
Suppose I want to write a book with many authors via the Web. The book has a hierarchical structure with chapter, sections, subsections, subsubsections, etc. At each moment it must be possible to print the current version of the book in PDF format. There must be automatic generation of the table of contents, indices, etc. Conversions to many formats (Latex, DocBook, etc.) would be welcome. Does something like that already exists?...
1
1816
by: Bryan | last post by:
at pycon, several mac users were using a collaborative text editor where each user's text background color was a different color as they edited the same document at the same time while they took notes during the lectures. does anyone know the name of that program? it was one of the coolest things i've ever seen :) thanks, bryan
27
5039
by: Eric | last post by:
Assume that disk space is not an issue (the files will be small < 5k in general for the purpose of storing preferences) Assume that transportation to another OS may never occur. Are there any solid reasons to prefer text files over binary files files?
1
3769
by: IkBenHet | last post by:
Hello, I found this script to create a simple rich text form (http://programmabilities.com/xml/index.php?id=17): <html> <head> <title>Rich Text Editor</title> </head> <body>
2
1872
by: Rudy Ray Moore | last post by:
Hi guys, I just upgraded to "Visual Studio .net 2003 7.1 c++" from VS6. Some things I like (proper for loop variable scoping, for example), but some other things are troubling me. One annoying behavior is that the text editor often "hangs" (doesn't let me type) while compiling. Is there a way to fix this so it behaves more like VS6 (editor does not hang while compiling)?
3
1810
by: PulsarSL | last post by:
Hey Do any of you know of an IDE or tool that allows two or more people to work on the same code in real-time? I know a text editor would work, but having code coloring and everything would be nice. I haven't been able to find anything with google, so I'm curious as to whether or not there really is one. Thanks
4
3123
by: pbreah | last post by:
I'm doing a Rich Text Editor (WYSIWYG) in javascript for a game for kids. I'm doing a special case in with every keystroke from A-Z creates a background and foreground color for that letter, witch is the same. The problem is editing doesn't work that well. For example when I type: ABCDFG , I get this code generated and displayed by the Rich Text Editor: <P><FONT style="BACKGROUND-COLOR: #ffff00" color=#ffff00>a<FONT...
34
2928
by: nicolasfr | last post by:
Hi, I am a bit disapointed with the current Python online documentation. I have read many messages of people complaining about the documentation, it's lack of examples and the use of complicated sentences that you need to read 10 times before understanding what it means. That's why I have started a collaborative project to make a user contributed Python documentation. The wiki is online here: http://www.pythondocs.info
3
14573
by: danesh1354 | last post by:
Hi All, First I need to construct a text editor by python programming and add this code to a biger code that has been written before, and i would like that by my code for this editor have a capability to save it into special file name and format, for instance if i want to save it to a file with XML extention format like A.xml, wondering if anybody kknows how to do that, if you have any idea please guide me through how to reach to these....
0
9930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9716
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9571
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8569
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6410
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4996
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3676
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3185
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.