IRC logs for #openttd.dev on OFTC at 2013-04-06
            
06:00:11 *** Dewin has quit IRC
07:53:15 *** Alberth has joined #openttd.dev
07:53:15 *** ChanServ sets mode: +v Alberth
08:06:19 *** frosch123 has joined #openttd.dev
08:06:19 *** ChanServ sets mode: +v frosch123
08:19:01 *** Supercheese has quit IRC
08:42:35 *** ntoskrnl has joined #openttd.dev
09:08:21 *** Zuu has joined #openttd.dev
09:08:21 *** ChanServ sets mode: +v Zuu
10:45:25 *** Ristovski has joined #openttd.dev
11:59:27 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r25148 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking"
12:10:17 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r25149 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking"
12:36:34 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r25150 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking"
13:16:09 <frosch123> http://devs.openttd.org/~frosch/diffs/tar_all.diff <- not exactly meant for review yet, but it seems to work now
13:16:30 <frosch123> it changes the treatment of files inside tars
13:16:46 <frosch123> the path of the tar is now considered as well, instead of only the path inside the tar
13:17:38 <frosch123> this simplifies a lot of the tar handling and allows absolute (i.e. unique) paths for referencing files in tars
13:18:09 <frosch123> however, it currently breaks the [newgrf] and profile configuration in openttd.cfg for newgrfs in tars
13:19:04 <frosch123> http://paste.openttdcoop.org/show/2210/ <- so, if it need breaking i wonder about changing it to some useful format in the first place :p
13:19:12 <frosch123> which would allow updating and such
13:20:21 <Alberth> does moving a tar file work?
13:21:09 <frosch123> what kind of moving?
13:22:37 <Alberth> eg from content_download/newgrf to newgrf or so
13:23:02 <Alberth> hmm, unpacking a tar to a dir with content could also be a case that should work
13:23:09 <frosch123> well, not while ottd is running :p
13:23:26 <Alberth> no hot moving of files? :D
13:23:31 <frosch123> but if the config uses relative paths from the searchpath, moving from content_download/newgrf to newgrf would work :)
13:24:05 <frosch123> [15:23] <Alberth> hmm, unpacking a tar to a dir with content could also be a case that should work <- that will work if you name the directory the same as the tar, including the ".tar"
13:24:20 <Alberth> lol
13:24:29 <frosch123> but normally i would think it should use the unique id to find moved files
13:24:51 <frosch123> @voice Rubidium
13:24:51 <DorpsGek> frosch123: Error: Rubidium is not in #openttd.dev.
13:24:56 <Alberth> that would be much better :)
13:24:58 <frosch123> @voice Rubidium_
13:24:58 *** DorpsGek sets mode: +v Rubidium_
13:25:42 <Rubidium_> Alberth: you can't move tar files right now while openttd is running either
13:26:23 <Alberth> actually you can, but it breaks openttd, I know :)
13:26:49 <Alberth> I was considering the case without openttd instances running only :)
15:32:54 *** Rubidium has joined #openttd.dev
15:32:55 *** Rubidium_ has quit IRC
16:19:06 <Zuu> Two assorted fixes to musa: http://devs.openttd.org/~zuu/musa-fix.patch
16:19:30 <Zuu> 1: Fixes detection of script short name when there was a comment after the GetShortName method
16:19:57 <Zuu> 2: Removes a unused parameter of a method. (a parameter that I forgot to add to the procedure argument list)
16:20:56 <Zuu> Fix #1 affects the behaviour while #2 only removes unused code.
16:28:33 <frosch123> does the same apply to bananas?
16:29:30 <Zuu> Bananas do not have the aditional checks for comments that I published a patch for as that patch has never been applied to my knowledge.
16:30:31 <Zuu> However, it would make sense to migrate the updated get_short_name logic to bananas. Or better allow musa and bananas to share common code.
16:31:09 <frosch123> bananas has various local changes on the server
16:31:20 <frosch123> root cannot commit or something :p
16:32:21 <Zuu> Though, I think last TB told me that he had not applied it.
16:33:27 <Zuu> Second patch: Adds a new command depgen.py for generating dependency items to use in musa .ini file: http://devs.openttd.org/~zuu/depgen.patch
16:35:10 *** Ristovski has quit IRC
16:36:14 <Zuu> So you can do ./depgen content_download/newgrf/some-newgrf.tar
16:36:56 <Zuu> and it will generate the string needed to be pasted into your .ini file to upload content that dependo no some-newgrf.tar.
16:37:52 <frosch123> + raise MusaException("depgen do not support Base Graphics") <- "does"
16:41:17 *** Ristovski has joined #openttd.dev
16:47:59 <Alberth> Zuu: line.find('/*') != -1 '/*' in line
16:48:42 <Alberth> if scanning == 4 and line.find('*/') != -1: <-- store the index to use it in the 'then' part
16:50:26 <Zuu> Does it matter performance wise?
16:51:09 *** ChanServ sets mode: +v Rubidium
16:53:17 <Alberth> you look for the same index twice
16:53:41 <Alberth> except: <-- that is very bad form, always catch precise those exceptions that you expect
16:54:10 <Alberth> ie bare 'except' would already fail on a typo in a function call
16:55:12 <Alberth> return { 'type': type, 'uniqueid': uniqueid, 'md5sum': "%032x" % md5sum } <-- why not simply return a triplet?
16:56:01 <Zuu> I used the same methodology as package_xyz in type.py of musa.
16:56:13 <Zuu> I have no idea what a triplet is in Python.
16:56:57 <Alberth> return a, b, c and multi-assignment a, b, c = f()
16:57:17 <Alberth> ie it is a tuple (a, b, c)
16:57:36 <Alberth> if re.search("extends\s+GSInfo", line) != None: <-- \ misses an escape
16:57:50 <Alberth> other lines there as well
16:58:09 <Zuu> Regarding the index lookup, yes from a hardcore performance perspective, I look up the same index more than onec. However the lookup is a simple loop over a quite short list. A solution that store and reuse the lookup will create longer code in a situation where the performance gain is probably not even noticable.
16:58:51 <Alberth> ok
16:59:12 <Zuu> Good catch regarding the missing escape.
16:59:46 <Alberth> should the 2nd 'if' not be an elif?
17:00:03 <Zuu> Yes it should.. I'll fix that
17:01:58 <Alberth> ext = file.split(".")[-1] + if ext == "nut": <-- file.endswith('.ext')
17:02:11 <Alberth> euhm '.nut' :)
17:02:42 <Alberth> doesn't that need a tolower btw?
17:05:12 <Alberth> there is also a .rfind for searching from the back, but it's probably not worth the trouble
17:07:13 <Alberth> if options.exclude is not None and options.exclude != "": <-- I would expect a test against an empty list
17:07:28 <Alberth> (and None probably)
17:08:42 <Zuu> I had .lower() for filenames in my already commited musa patch however I got the comment that we shouldn't be case insensitive in general. however, when I ran depgen on my whole content_dowload/newgrf, I found a few tar files with uppercase .GRF inside the tars. Thus I added it back there for the file extension. However I do think most script authors are sensible enough to not use upper case file extensions.
17:09:55 <Zuu> I had file.endswith(".obg") etc. before, but extracted the code that determines the extension to only have simple == checks on each if-statement.
17:10:05 <Alberth> ("%08x" % uniqueid_int).upper() <-- "%08X" % uniqueid_int
17:11:01 <Alberth> However I do think most script authors are sensible enough to not use upper case file extensions. <-- haha, find a random windows system and check :)
17:11:32 <Alberth> ie the os does not complain, so users are not even aware of what they do :)
17:13:10 <Alberth> that is all I have to say about this patch
17:14:25 <Zuu> Alberth: Why "%08X" and not "%08x"?
17:14:40 <Zuu> Musa uses "%032x" at other places.
17:14:59 <Alberth> uppercase A-F
17:15:26 <Alberth> >>> print "%08X" % 10
17:15:26 <Alberth> 0000000A
17:16:06 <Zuu> Ah.. upper case without using .upper()
17:17:30 <Alberth> C/C++ does it too :)
17:17:55 <Zuu> I usually don't print to hex.
17:18:27 <Alberth> %e vs %E then?
17:18:40 <Zuu> And anyway Delphi uses their own format % codes that are completely different to C++ and the rest of the world. :-)
17:19:03 <Alberth> Hmm, exception texts are also not consistent in style
17:19:13 <Zuu> %n = number (floating); %d = decimal (integer)
17:19:26 <Zuu> At least %s is string..
17:19:27 <Alberth> right :)
17:19:35 <Alberth> %d works in C too
17:21:22 <Alberth> I wonder what %7% does in C++; Java just prints "%" instead of % and 6 spaces
17:45:18 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r25151 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking"
18:30:46 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r25152 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking"
18:36:41 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r25153 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking"
18:36:46 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r25154 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking"
18:36:49 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r25155 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking"
18:52:53 *** Dewin has joined #openttd.dev
18:57:18 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r25156 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking"
19:10:01 *** ntoskrnl has quit IRC
19:40:32 *** Alberth has left #openttd.dev
21:14:44 *** Ristovski has quit IRC
21:17:28 *** Ristovski has joined #openttd.dev
21:44:23 *** Ristovski has quit IRC
22:00:19 *** Dewin has quit IRC
22:06:46 *** DorpsGek changes topic to "OpenTTD Dev Channel || Latest SVN: r25157 || Logs: http://webster.openttdcoop.org/?channel=openttd.dev || Voice (talk-right) upon request via #openttd; make sure you are registered to NickServ before asking"
22:18:31 *** frosch123 has quit IRC