Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #37026 > unrolled thread
| Started by | Ferrous Cranus <nikos.gr33k@gmail.com> |
|---|---|
| First post | 2013-01-18 12:48 -0800 |
| Last post | 2013-01-19 00:39 -0800 |
| Articles | 20 on this page of 62 — 14 participants |
Back to article view | Back to comp.lang.python
Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-18 12:48 -0800
Re: Uniquely identifying each & every html template John Gordon <gordon@panix.com> - 2013-01-18 20:59 +0000
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-18 14:12 -0800
Re: Uniquely identifying each & every html template Dave Angel <d@davea.name> - 2013-01-18 17:09 -0500
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-19 00:39 -0800
Re: Uniquely identifying each & every html template Dave Angel <d@davea.name> - 2013-01-19 04:00 -0500
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-20 23:08 -0800
Re: Uniquely identifying each & every html template Chris Angelico <rosuav@gmail.com> - 2013-01-21 18:20 +1100
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-21 01:19 -0800
Re: Uniquely identifying each & every html template Chris Angelico <rosuav@gmail.com> - 2013-01-21 20:31 +1100
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-21 04:06 -0800
Re: Uniquely identifying each & every html template Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-01-21 12:39 +0000
Re: Uniquely identifying each & every html template alex23 <wuwei23@gmail.com> - 2013-01-21 04:55 -0800
Re: Uniquely identifying each & every html template rusi <rustompmody@gmail.com> - 2013-01-21 19:24 -0800
Re: Uniquely identifying each & every html template Chris Angelico <rosuav@gmail.com> - 2013-01-22 15:39 +1100
Re: Uniquely identifying each & every html template Tom P <werotizy@freent.dd> - 2013-01-22 00:01 +0100
Re: Uniquely identifying each & every html template Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-01-21 23:43 +0000
Re: Uniquely identifying each & every html template Chris Angelico <rosuav@gmail.com> - 2013-01-22 11:04 +1100
Re: Uniquely identifying each & every html template alex23 <wuwei23@gmail.com> - 2013-01-22 17:36 -0800
Re: Uniquely identifying each & every html template Joel Goldstick <joel.goldstick@gmail.com> - 2013-01-21 07:47 -0500
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-21 07:00 -0800
Re: Uniquely identifying each & every html template Michael Torrie <torriem@gmail.com> - 2013-01-22 16:55 -0700
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-23 01:12 -0800
Re: Uniquely identifying each & every html template alex23 <wuwei23@gmail.com> - 2013-01-23 01:37 -0800
Re: Uniquely identifying each & every html template Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-01-23 09:49 +0000
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-23 02:29 -0800
Re: Uniquely identifying each & every html template Joel Goldstick <joel.goldstick@gmail.com> - 2013-01-23 07:03 -0500
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-23 04:26 -0800
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-23 04:26 -0800
Re: Uniquely identifying each & every html template alex23 <wuwei23@gmail.com> - 2013-01-23 06:25 -0800
Re: Uniquely identifying each & every html template Dave Angel <d@davea.name> - 2013-01-23 07:38 -0500
Re: Uniquely identifying each & every html template Chris Angelico <rosuav@gmail.com> - 2013-01-24 10:25 +1100
Re: Uniquely identifying each & every html template Dave Angel <d@davea.name> - 2013-01-23 19:09 -0500
Re: Uniquely identifying each & every html template Chris Angelico <rosuav@gmail.com> - 2013-01-24 11:39 +1100
Re: Uniquely identifying each & every html template Dave Angel <d@davea.name> - 2013-01-23 19:53 -0500
Re: Uniquely identifying each & every html template Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-01-23 16:01 -0500
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-23 01:12 -0800
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-21 07:00 -0800
Re: Uniquely identifying each & every html template Dave Angel <d@davea.name> - 2013-01-21 17:26 -0500
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-21 04:06 -0800
Re: Uniquely identifying each & every html template Tim Roberts <timr@probo.com> - 2013-01-21 19:57 -0800
Re: Uniquely identifying each & every html template Tim Roberts <timr@probo.com> - 2013-01-21 20:04 -0800
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-21 22:49 -0800
Re: Uniquely identifying each & every html template Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-01-22 16:08 -0500
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-23 01:15 -0800
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-23 01:15 -0800
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-21 01:19 -0800
Re: Uniquely identifying each & every html template alex23 <wuwei23@gmail.com> - 2013-01-21 04:56 -0800
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-21 07:03 -0800
Re: Uniquely identifying each & every html template alex23 <wuwei23@gmail.com> - 2013-01-21 15:35 -0800
Re: Uniquely identifying each & every html template Piet van Oostrum <piet@vanoostrum.org> - 2013-01-21 21:48 +0100
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-21 22:38 -0800
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-21 07:07 -0800
Re: Uniquely identifying each & every html template alex23 <wuwei23@gmail.com> - 2013-01-21 15:36 -0800
Re: Uniquely identifying each & every html template rusi <rustompmody@gmail.com> - 2013-01-21 20:18 -0800
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-21 07:07 -0800
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-20 23:08 -0800
Re: Uniquely identifying each & every html template Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-01-19 16:32 -0500
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-20 22:52 -0800
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-20 22:52 -0800
Re: Uniquely identifying each & every html template John Gordon <gordon@panix.com> - 2013-01-22 16:35 +0000
Re: Uniquely identifying each & every html template Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-19 00:39 -0800
Page 3 of 4 — ← Prev page 1 2 [3] 4 Next page →
| From | Tim Roberts <timr@probo.com> |
|---|---|
| Date | 2013-01-21 19:57 -0800 |
| Message-ID | <ad3sf81li0i9uegg5a1fcg7ejtffpgtk4a@4ax.com> |
| In reply to | #37183 |
Ferrous Cranus <nikos.gr33k@gmail.com> wrote: > >No, it is difficult but not impossible. >It just cannot be done by tagging the file by: > >1. filename >2. filepath >3. hash (math algorithm producing a string based on the file's contents) > >We need another way to identify the file WITHOUT using the above attributes. Think about it this way. Say that YOU, as a human being, were inserted into the web server. You are handed the path and the contents of a page about to be served. How would YOU solve this problem? If you can't describe in words how YOU would recognize these altered files, then there is absolutely no way to teach a computer how to do it. It IS impossible. -- Tim Roberts, timr@probo.com Providenza & Boekelheide, Inc.
[toc] | [prev] | [next] | [standalone]
| From | Tim Roberts <timr@probo.com> |
|---|---|
| Date | 2013-01-21 20:04 -0800 |
| Message-ID | <ln3sf85d4nppatl5o2hrn2e1kl65csada4@4ax.com> |
| In reply to | #37172 |
Ferrous Cranus <nikos.gr33k@gmail.com> wrote:
>
>Renames and moves are performed, either by shell access or either by cPanel access by website owners.
>
>That being said i have no control on HOW and WHEN users alter their html pages.
Right, and that makes it impossible to solve this problem.
Think about some scenarios. Let's say I have a web site with two pages:
~/web/page1.html
~/web/page2.html
Now let's say I use some editor to make a copy of page1 called page1a.html.
~/web/page1.html
~/web/page1a.html
~/web/page2.html
Should page1a.html be considered the same page as page1.html? What if I
subsequently delete page1.html? What if I don't? How long will you wait
before deciding they are the same?
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
[toc] | [prev] | [next] | [standalone]
| From | Ferrous Cranus <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-01-21 22:49 -0800 |
| Message-ID | <179d586e-1fa7-4b2e-8ef2-25b99bf46116@googlegroups.com> |
| In reply to | #37247 |
Τη Τρίτη, 22 Ιανουαρίου 2013 6:04:09 π.μ. UTC+2, ο χρήστης Tim Roberts έγραψε: > Ferrous Cranus <nikos.gr33k@gmail.com> wrote: > > > > > >Renames and moves are performed, either by shell access or either by cPanel access by website owners. > > > > > >That being said i have no control on HOW and WHEN users alter their html pages. > > > > Right, and that makes it impossible to solve this problem. > > > > Think about some scenarios. Let's say I have a web site with two pages: > > ~/web/page1.html > > ~/web/page2.html > > > > Now let's say I use some editor to make a copy of page1 called page1a.html. > > ~/web/page1.html > > ~/web/page1a.html > > ~/web/page2.html > > > > Should page1a.html be considered the same page as page1.html? What if I > > subsequently delete page1.html? What if I don't? How long will you wait > > before deciding they are the same? > > -- > > Tim Roberts, timr@probo.com > > Providenza & Boekelheide, Inc. You are right, it cannot be done. So i have 2 options . Either identify an .html file from its "filepath" or from its "hash". Which method do you advice me to utilize?
[toc] | [prev] | [next] | [standalone]
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Date | 2013-01-22 16:08 -0500 |
| Message-ID | <mailman.837.1358888955.2939.python-list@python.org> |
| In reply to | #37253 |
On Mon, 21 Jan 2013 22:49:31 -0800 (PST), Ferrous Cranus
<nikos.gr33k@gmail.com> declaimed the following in
gmane.comp.python.general:
> You are right, it cannot be done.
>
> So i have 2 options .
>
> Either identify an .html file from its "filepath" or from its "hash".
>
> Which method do you advice me to utilize?
The hash identifies based upon the file contents -- any edit to the
file will result in a different hash (and if the hash system isn't large
enough, you may even encounter collisions where two or more files have
the same hash). However, moving or renaming the file should still
produce the same hash.
Path/name at least lets the file contents be edited. Anything that
changes the path/name will be seen as a new file.
Which condition is most useful to your needs: allowing free content
edits while keeping the counter tied to the end URL; or tying the
counter to a fixed page but letting the URL to that page change.
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
[toc] | [prev] | [next] | [standalone]
| From | Ferrous Cranus <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-01-23 01:15 -0800 |
| Message-ID | <1c84a142-a40c-425d-82f2-6916c709f0ee@googlegroups.com> |
| In reply to | #37349 |
Τη Τρίτη, 22 Ιανουαρίου 2013 11:08:57 μ.μ. UTC+2, ο χρήστης Dennis Lee Bieber έγραψε: > On Mon, 21 Jan 2013 22:49:31 -0800 (PST), Ferrous Cranus > > <nikos.gr33k@gmail.com> declaimed the following in > > gmane.comp.python.general: > > > > > You are right, it cannot be done. > > > > > > So i have 2 options . > > > > > > Either identify an .html file from its "filepath" or from its "hash". > > > > > > Which method do you advice me to utilize? > > > > The hash identifies based upon the file contents -- any edit to the > > file will result in a different hash (and if the hash system isn't large > > enough, you may even encounter collisions where two or more files have > > the same hash). However, moving or renaming the file should still > > produce the same hash. > > > > Path/name at least lets the file contents be edited. Anything that > > changes the path/name will be seen as a new file. > > > > Which condition is most useful to your needs: allowing free content > > edits while keeping the counter tied to the end URL; or tying the > > counter to a fixed page but letting the URL to that page change. The best would be to: Allow free content edits, while the URL to that page may also change.
[toc] | [prev] | [next] | [standalone]
| From | Ferrous Cranus <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-01-23 01:15 -0800 |
| Message-ID | <mailman.873.1358932535.2939.python-list@python.org> |
| In reply to | #37349 |
Τη Τρίτη, 22 Ιανουαρίου 2013 11:08:57 μ.μ. UTC+2, ο χρήστης Dennis Lee Bieber έγραψε: > On Mon, 21 Jan 2013 22:49:31 -0800 (PST), Ferrous Cranus > > <nikos.gr33k@gmail.com> declaimed the following in > > gmane.comp.python.general: > > > > > You are right, it cannot be done. > > > > > > So i have 2 options . > > > > > > Either identify an .html file from its "filepath" or from its "hash". > > > > > > Which method do you advice me to utilize? > > > > The hash identifies based upon the file contents -- any edit to the > > file will result in a different hash (and if the hash system isn't large > > enough, you may even encounter collisions where two or more files have > > the same hash). However, moving or renaming the file should still > > produce the same hash. > > > > Path/name at least lets the file contents be edited. Anything that > > changes the path/name will be seen as a new file. > > > > Which condition is most useful to your needs: allowing free content > > edits while keeping the counter tied to the end URL; or tying the > > counter to a fixed page but letting the URL to that page change. The best would be to: Allow free content edits, while the URL to that page may also change.
[toc] | [prev] | [next] | [standalone]
| From | Ferrous Cranus <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-01-21 01:19 -0800 |
| Message-ID | <mailman.734.1358762078.2939.python-list@python.org> |
| In reply to | #37163 |
Τη Δευτέρα, 21 Ιανουαρίου 2013 9:20:15 π.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Mon, Jan 21, 2013 at 6:08 PM, Ferrous Cranus <nikos.gr33k@gmail.com> wrote: > > > An .html page must retain its database counter value even if its: > > > > > > (renamed && moved && contents altered) > > > > Then you either need to tag them in some external way, or have some > > kind of tracking operation - for instance, if you require that all > > renames/moves be done through a script, that script can update its > > pointer. Otherwise, you need magic, and lots of it. > > > > ChrisA This python script acts upon websites other people use and every html templates has been written by different methods(notepad++, dreamweaver, joomla). Renames and moves are performed, either by shell access or either by cPanel access by website owners. That being said i have no control on HOW and WHEN users alter their html pages.
[toc] | [prev] | [next] | [standalone]
| From | alex23 <wuwei23@gmail.com> |
|---|---|
| Date | 2013-01-21 04:56 -0800 |
| Message-ID | <291e92a6-c984-4636-927a-ed6cd78e49d1@pu9g2000pbc.googlegroups.com> |
| In reply to | #37174 |
On Jan 21, 7:19 pm, Ferrous Cranus <nikos.gr...@gmail.com> wrote: > Renames and moves are performed, either by shell access or either by cPanel access by website owners. These websites owners, are you charging them for this "service" you provide? You seriously need to read up on some fundamentals of how the web + apache + Python works. As it stands, you're asking us to do your job for you, and it's getting TEDIOUS with you TELLING us how WRONG we are.
[toc] | [prev] | [next] | [standalone]
| From | Ferrous Cranus <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-01-21 07:03 -0800 |
| Message-ID | <97131fb6-26d9-488c-8929-6cb721447028@googlegroups.com> |
| In reply to | #37188 |
Τη Δευτέρα, 21 Ιανουαρίου 2013 2:56:24 μ.μ. UTC+2, ο χρήστης alex23 έγραψε: > On Jan 21, 7:19 pm, Ferrous Cranus <nikos.gr...@gmail.com> wrote: > > > Renames and moves are performed, either by shell access or either by cPanel access by website owners. > > > > These websites owners, are you charging them for this "service" you > > provide? > > > > You seriously need to read up on some fundamentals of how the web + > > apache + Python works. As it stands, you're asking us to do your job > > for you, and it's getting TEDIOUS with you TELLING us how WRONG we are. Dude, i host 4 sites of friend fo mine who want the same type of counter like i use iun my website. ALL, iam asking for is a way to make this work.
[toc] | [prev] | [next] | [standalone]
| From | alex23 <wuwei23@gmail.com> |
|---|---|
| Date | 2013-01-21 15:35 -0800 |
| Message-ID | <c8a45ca2-8114-415c-aaf4-90f5d0e21f26@ui9g2000pbc.googlegroups.com> |
| In reply to | #37201 |
On Jan 22, 1:03 am, Ferrous Cranus <nikos.gr...@gmail.com> wrote: > ALL, iam asking for is a way to make this work. No, ALL you are asking is for us to take an _impossible_ situation and make it magically work for you, without your having to improve your understanding of the problem or modifying your requirements in any way. You don't see *your ignorance* as the problem, preferring instead to blame others and Python itself for your failings. None of the solutions proposed satisfy you because they seem like too much work, and you're convinced that this can just happen. It can't, and you desperately need to educate yourself on some vital aspects of _how the web works_ (and Python, and file systems, and *NIX environments etc etc).
[toc] | [prev] | [next] | [standalone]
| From | Piet van Oostrum <piet@vanoostrum.org> |
|---|---|
| Date | 2013-01-21 21:48 +0100 |
| Message-ID | <m2mww2p8j8.fsf@cochabamba.vanoostrum.org> |
| In reply to | #37174 |
Ferrous Cranus <nikos.gr33k@gmail.com> writes: > This python script acts upon websites other people use and every html > templates has been written by different methods(notepad++, > dreamweaver, joomla). > > Renames and moves are performed, either by shell access or either by > cPanel access by website owners. > > That being said i have no control on HOW and WHEN users alter their html pages. Under these circumstances the only way to solve it is to put an identification *inside* the file and make sure it will not be changed. It could for example be some invisible piece of HTML, or an attribute to some tag. If that can't be done the problem cannot be solved and it makes no sense keeping asking the same question over and over again. -- Piet van Oostrum <piet@vanoostrum.org> WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4]
[toc] | [prev] | [next] | [standalone]
| From | Ferrous Cranus <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-01-21 22:38 -0800 |
| Message-ID | <a3763050-c81f-4ac9-ad40-4658e26c5309@googlegroups.com> |
| In reply to | #37225 |
Τη Δευτέρα, 21 Ιανουαρίου 2013 10:48:11 μ.μ. UTC+2, ο χρήστης Piet van Oostrum έγραψε: > Ferrous Cranus <nikos.gr33k@gmail.com> writes: > > > > > This python script acts upon websites other people use and every html > > > templates has been written by different methods(notepad++, > > > dreamweaver, joomla). > > > > > > Renames and moves are performed, either by shell access or either by > > > cPanel access by website owners. > > > > > > That being said i have no control on HOW and WHEN users alter their html pages. > > > > Under these circumstances the only way to solve it is to put an > > identification *inside* the file and make sure it will not be changed. > > It could for example be some invisible piece of HTML, or an attribute to > > some tag. If that can't be done the problem cannot be solved and it > > makes no sense keeping asking the same question over and over again. The solution you propose is what i already use for my website. Since its my website i can edit all the .html i want embedding a unique number in each and evey one of them as i showed in my initial post. Problem is i'am not allowed to do the same with the other websites i host. And apart from that even if i was allowed to, an html page could be rewritten thus the identified would get lost.
[toc] | [prev] | [next] | [standalone]
| From | Ferrous Cranus <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-01-21 07:07 -0800 |
| Message-ID | <231d970b-da08-475d-b53c-ebbad032658b@googlegroups.com> |
| In reply to | #37163 |
Τη Δευτέρα, 21 Ιανουαρίου 2013 9:20:15 π.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Mon, Jan 21, 2013 at 6:08 PM, Ferrous Cranus <nikos.gr33k@gmail.com> wrote: > > > An .html page must retain its database counter value even if its: > > > > > > (renamed && moved && contents altered) > > > > Then you either need to tag them in some external way, or have some > > kind of tracking operation - for instance, if you require that all > > renames/moves be done through a script, that script can update its > > pointer. Otherwise, you need magic, and lots of it. > > > > ChrisA Perhaps we should look into on how's the OS handles the file to get an idea on how its done?
[toc] | [prev] | [next] | [standalone]
| From | alex23 <wuwei23@gmail.com> |
|---|---|
| Date | 2013-01-21 15:36 -0800 |
| Message-ID | <72375b47-cd1b-4cf6-a9cf-04187ecb9e26@y5g2000pbi.googlegroups.com> |
| In reply to | #37202 |
On Jan 22, 1:07 am, Ferrous Cranus <nikos.gr...@gmail.com> wrote: > Perhaps we should look into on how's the OS handles the file to get an idea on how its done? Who is this "we" you speak of? You mean "you", right? You do that and get back to us when you believe you've found something that helps.
[toc] | [prev] | [next] | [standalone]
| From | rusi <rustompmody@gmail.com> |
|---|---|
| Date | 2013-01-21 20:18 -0800 |
| Message-ID | <e09bcd77-261a-41d8-9197-95c13ce1dacb@r10g2000pbd.googlegroups.com> |
| In reply to | #37202 |
On Jan 21, 8:07 pm, Ferrous Cranus <nikos.gr...@gmail.com> wrote: > Τη Δευτέρα, 21 Ιανουαρίου 2013 9:20:15 π.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > > > > > > > > > > > On Mon, Jan 21, 2013 at 6:08 PM, Ferrous Cranus <nikos.gr...@gmail.com> wrote: > > > > An .html page must retain its database counter value even if its: > > > > (renamed && moved && contents altered) > > > Then you either need to tag them in some external way, or have some > > > kind of tracking operation - for instance, if you require that all > > > renames/moves be done through a script, that script can update its > > > pointer. Otherwise, you need magic, and lots of it. > > > ChrisA > > Perhaps we should look into on how's the OS handles the file to get an idea on how its done? Yes… Perhaps the most useful for you suggestion Ive seen in this thread is to look at git. If you do you will find that a. git has to do a great deal more work than you expect to factorize out content-tracking from file-tracking b. Yet it can get it wrong Look at snapshoting file systems http://en.wikipedia.org/wiki/Snapshot_%28computer_storage%29#File_systems like winfs (cancelled) and btrfs Slightly more practical may be timevault http://www.dedoimedo.com/computers/timevault.html
[toc] | [prev] | [next] | [standalone]
| From | Ferrous Cranus <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-01-21 07:07 -0800 |
| Message-ID | <mailman.748.1358780834.2939.python-list@python.org> |
| In reply to | #37163 |
Τη Δευτέρα, 21 Ιανουαρίου 2013 9:20:15 π.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Mon, Jan 21, 2013 at 6:08 PM, Ferrous Cranus <nikos.gr33k@gmail.com> wrote: > > > An .html page must retain its database counter value even if its: > > > > > > (renamed && moved && contents altered) > > > > Then you either need to tag them in some external way, or have some > > kind of tracking operation - for instance, if you require that all > > renames/moves be done through a script, that script can update its > > pointer. Otherwise, you need magic, and lots of it. > > > > ChrisA Perhaps we should look into on how's the OS handles the file to get an idea on how its done?
[toc] | [prev] | [next] | [standalone]
| From | Ferrous Cranus <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-01-20 23:08 -0800 |
| Message-ID | <mailman.728.1358752089.2939.python-list@python.org> |
| In reply to | #37076 |
Τη Σάββατο, 19 Ιανουαρίου 2013 11:00:15 π.μ. UTC+2, ο χρήστης Dave Angel έγραψε: > On 01/19/2013 03:39 AM, Ferrous Cranus wrote: > > > Τη Σάββατο, 19 Ιανουαρίου 2013 12:09:28 π.μ. UTC+2, ο χρήστης Dave Angel έγραψε: > > > > > >> I don't understand the problem. A trivial Python script could scan > > >> > > >> through all the files in the directory, checking which ones are missing > > >> > > >> the identifier, and rewriting the file with the identifier added. > > > > > >> > > >> So, since you didn't come to that conclusion, there must be some other > > >> > > >> reason you don't want to edit the files. Is it that the real sources > > >> > > >> are elsewhere (e.g. Dreamweaver), and whenever one recompiles those > > >> > > >> sources, these files get replaced (without identifiers)? > > > > > > Exactly. Files get modified/updates thus the embedded identifier will be missing each time. So, relying on embedding code to html template content is not practical. > > > > > > > > >> If that's the case, then I figure you have about 3 choices: > > >> 1) use the file path as your key, instead of requiring a number > > > > > > No, i cannot, because it would mess things at a later time on when i for example: > > > > > > 1. mv name.html othername.html (document's filename altered) > > > 2. mv name.html /subfolder/name.html (document's filepath altered) > > > > > > Hence, new database counters will be created for each of the above actions, therefore i will be having 2 counters for the same file, and the latter one will start from a zero value. > > > > > > Pros: If the file's contents gets updated, that won't affect the counter. > > > Cons: If filepath is altered, then duplicity will happen. > > > > > > > > >> 2) use a hash of the page (eg. md5) as your key. of course this could > > >> mean that you get a new value whenever the page is updated. That's good > > >> in many situations, but you don't give enough information to know if > > >> that's desirable for you or not. > > > > > > That sounds nice! A hash is a mathematical algorithm that produce a unique number after analyzing each file's contents? But then again what if the html templated gets updated? That update action will create a new hash for the file, hence another counter will be created for the same file, same end result as (1) solution. > > > > > > Pros: If filepath is altered, that won't affect the counter. > > > Cons: If file's contents gets updated the, then duplicity will happen. > > > > > > > > >> 3) Keep an external list of filenames, and their associated id numbers. > > >> The database would be a good place to store such a list, in a separate table. > > > > > > I did not understand that solution. > > > > > > > > > We need to find a way so even IF: > > > > > > (filepath gets modified && file content's gets modified) simultaneously the counter will STILL retains it's value. > > > > > > > You don't yet have a programming problem, you have a specification > > problem. Somehow, you want a file to be considered "the same" even when > > it's moved, renamed and/or modified. So all files are the same, and you > > only need one id. > > Don't pick a mechanism until you have an self-consistent spec. I do have the specification. An .html page must retain its database counter value even if its: (renamed && moved && contents altered) [original attributes of the file]: filename: index.html filepath: /home/nikos/public_html/ contents: <html> Hello </html> [get modified to]: filename: index2.html filepath: /home/nikos/public_html/folder/subfolder/ contents: <html> Hello, people </html> The file is still the same, even though its attributes got modified. We want counter.py script to still be able to "identify" the .html page, hence its counter value in order to get increased properly.
[toc] | [prev] | [next] | [standalone]
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Date | 2013-01-19 16:32 -0500 |
| Message-ID | <mailman.700.1358631163.2939.python-list@python.org> |
| In reply to | #37073 |
On Sat, 19 Jan 2013 00:39:44 -0800 (PST), Ferrous Cranus
<nikos.gr33k@gmail.com> declaimed the following in
gmane.comp.python.general:
> We need to find a way so even IF:
>
> (filepath gets modified && file content's gets modified) simultaneously the counter will STILL retains it's value.
The only viable solution the /I/ can visualize is one in which any
operation ON the template file MUST ALSO operate on the counter... That
is; you only operate on the templates using a front-end application that
automatically links the counter information every time...
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
[toc] | [prev] | [next] | [standalone]
| From | Ferrous Cranus <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-01-20 22:52 -0800 |
| Message-ID | <f089a262-49b5-4963-8974-94401f87eacd@googlegroups.com> |
| In reply to | #37099 |
Τη Σάββατο, 19 Ιανουαρίου 2013 11:32:41 μ.μ. UTC+2, ο χρήστης Dennis Lee Bieber έγραψε: > On Sat, 19 Jan 2013 00:39:44 -0800 (PST), Ferrous Cranus > > <nikos.gr33k@gmail.com> declaimed the following in > > gmane.comp.python.general: > > > We need to find a way so even IF: > > > > > > (filepath gets modified && file content's gets modified) simultaneously the counter will STILL retains it's value. > > > > The only viable solution the /I/ can visualize is one in which any > > operation ON the template file MUST ALSO operate on the counter... That > > is; you only operate on the templates using a front-end application that > > automatically links the counter information every time... > > -- > > Wulfraed Dennis Lee Bieber AF6VN > > wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/ CANNOT BE DONE because every html templates has been written by different methods. dramweaver joomla notepad++
[toc] | [prev] | [next] | [standalone]
| From | Ferrous Cranus <nikos.gr33k@gmail.com> |
|---|---|
| Date | 2013-01-20 22:52 -0800 |
| Message-ID | <mailman.727.1358751150.2939.python-list@python.org> |
| In reply to | #37099 |
Τη Σάββατο, 19 Ιανουαρίου 2013 11:32:41 μ.μ. UTC+2, ο χρήστης Dennis Lee Bieber έγραψε: > On Sat, 19 Jan 2013 00:39:44 -0800 (PST), Ferrous Cranus > > <nikos.gr33k@gmail.com> declaimed the following in > > gmane.comp.python.general: > > > We need to find a way so even IF: > > > > > > (filepath gets modified && file content's gets modified) simultaneously the counter will STILL retains it's value. > > > > The only viable solution the /I/ can visualize is one in which any > > operation ON the template file MUST ALSO operate on the counter... That > > is; you only operate on the templates using a front-end application that > > automatically links the counter information every time... > > -- > > Wulfraed Dennis Lee Bieber AF6VN > > wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/ CANNOT BE DONE because every html templates has been written by different methods. dramweaver joomla notepad++
[toc] | [prev] | [next] | [standalone]
Page 3 of 4 — ← Prev page 1 2 [3] 4 Next page →
Back to top | Article view | comp.lang.python
csiph-web