]> git.itanic.dy.fi Git - emerge-timer/log
emerge-timer
12 years agoUse float number when dealing with the time simplification
Esko Kokkonen [Sun, 18 Dec 2011 12:09:15 +0000 (14:09 +0200)]
Use float number when dealing with the time simplification

This could bug out if you would give an int to the function, in which
case it wouldn't return correct results

12 years agoModify printouts slightly
Esko Kokkonen [Sat, 10 Dec 2011 16:22:46 +0000 (18:22 +0200)]
Modify printouts slightly

Make the lines in minimum/maximum printing sections behave a bit
better.

12 years agoAdd empty file to third_fake_package directory
Esko Kokkonen [Sat, 10 Dec 2011 15:18:23 +0000 (17:18 +0200)]
Add empty file to third_fake_package directory

Stupid git...

12 years agoAdd a check for a possible error scenario in the simulation mode
Esko Kokkonen [Sat, 10 Dec 2011 15:15:18 +0000 (17:15 +0200)]
Add a check for a possible error scenario in the simulation mode

12 years agoFix possible error in current emerge mode
Esko Kokkonen [Sat, 10 Dec 2011 15:13:06 +0000 (17:13 +0200)]
Fix possible error in current emerge mode

This error could happen in cases where the current package has never
been emerged. The printout should now correctly just print 'unknown'
in these cases.

12 years agoAdd empty files to the fake portage tree
Esko Kokkonen [Tue, 29 Nov 2011 16:42:45 +0000 (18:42 +0200)]
Add empty files to the fake portage tree

Turns out git doesn't add empty directories.

12 years agoAdd a simulation mode setting
Esko Kokkonen [Tue, 29 Nov 2011 16:39:28 +0000 (18:39 +0200)]
Add a simulation mode setting

This allows for the testing of the program to check for possible
errors and other things without actually running emerge

12 years agoAdd the red colour
Esko Kokkonen [Tue, 29 Nov 2011 16:37:09 +0000 (18:37 +0200)]
Add the red colour

12 years agoFix current emerge_time calculations
Esko Kokkonen [Tue, 29 Nov 2011 16:33:21 +0000 (18:33 +0200)]
Fix current emerge_time calculations

Change where in the for loop we actually put the emerge time into the
packages classes emerge_time variable. This means we have to change
the place where the initial "infinity" time is given.

12 years agoDon't crash if we can't calculate current emerge time
Esko Kokkonen [Tue, 29 Nov 2011 16:31:42 +0000 (18:31 +0200)]
Don't crash if we can't calculate current emerge time

If we encounter an emerge time which for some reason we cannot
calculate (or something weird happens) printout only 'unknown'

12 years agoChange printouts with average times in current mode
Esko Kokkonen [Tue, 29 Nov 2011 16:30:09 +0000 (18:30 +0200)]
Change printouts with average times in current mode

Print average times also when there has been only one previous emerge.

12 years agoChange how current emerge time is calculated a bit
Esko Kokkonen [Tue, 29 Nov 2011 15:56:28 +0000 (17:56 +0200)]
Change how current emerge time is calculated a bit

Instead of having some ceiling value for the emerge time (like it was
previously 12*3600 seconds) calculate current emerge time from each of
the entries in the log and choose the smallet value. This should
always be the last entry on the log and therefore the one that was
started closest to the current time.

In other words; the current emerge mode now works for all those
countless packages that take days compile.

12 years agoTrivial change in comment description
Esko Kokkonen [Mon, 28 Nov 2011 09:10:53 +0000 (11:10 +0200)]
Trivial change in comment description

12 years agolist_emerge_processes(): Don't exit the program, only return from the function
Esko Kokkonen [Sat, 26 Nov 2011 15:11:51 +0000 (17:11 +0200)]
list_emerge_processes(): Don't exit the program, only return from the function

Exiting the whole program at this early point is not always what we
want. It is better to exit the function and resume the main function
in case we want to do something else in the program.

12 years agoGive text some color
Esko Kokkonen [Sat, 1 Oct 2011 11:21:47 +0000 (14:21 +0300)]
Give text some color

The "any time now" message was missing its color.

12 years agoFix crash if package has never been emerged
Esko Kokkonen [Sun, 25 Sep 2011 11:11:56 +0000 (14:11 +0300)]
Fix crash if package has never been emerged

Show message that the package hasn't been emerged before.

12 years agoDon't overwrite global no color flag
Esko Kokkonen [Sat, 24 Sep 2011 14:45:20 +0000 (17:45 +0300)]
Don't overwrite global no color flag

This takes into accout if we have defined green_start as "" globally
and therefore don't need to do that again in the give_time function.

12 years agoprint_versions(): Pad strings correctly when colors are used
Esko Kokkonen [Sat, 24 Sep 2011 14:36:16 +0000 (17:36 +0300)]
print_versions(): Pad strings correctly when colors are used

Color characters aren't counted when they appear in the screen, but
len() does count them, so we need a special fix for the padding to
work properly in these cases.

12 years agogive_time(): Add nocolor option
Esko Kokkonen [Sat, 24 Sep 2011 14:32:24 +0000 (17:32 +0300)]
give_time(): Add nocolor option

Calling the noclor=True causes the function to return the time string
without the colors.

12 years agoBeautify output (cont.)
Esko Kokkonen [Sat, 24 Sep 2011 11:33:10 +0000 (14:33 +0300)]
Beautify output (cont.)

Have the date string also start on the same place on each row.

12 years agoChange variable name
Esko Kokkonen [Sat, 24 Sep 2011 11:32:03 +0000 (14:32 +0300)]
Change variable name

"string_lenght" -> "version_length". More descriptive names are
better!

12 years agoBeautify output
Esko Kokkonen [Sat, 24 Sep 2011 11:23:51 +0000 (14:23 +0300)]
Beautify output

Have the '>>>' start on the same place on each row for easy emerge
time comparison.

12 years agoFix spacing in current emerge printout
Esko Kokkonen [Sat, 24 Sep 2011 11:13:43 +0000 (14:13 +0300)]
Fix spacing in current emerge printout

Add one additional space to the printing so different packages are
sort of on their own.

12 years agoFix error with global variable name
Esko Kokkonen [Fri, 23 Sep 2011 13:57:22 +0000 (16:57 +0300)]
Fix error with global variable name

This was left unchanged after a recent commit

12 years agoRename functions time() and date()
Esko Kokkonen [Fri, 23 Sep 2011 12:17:29 +0000 (15:17 +0300)]
Rename functions time() and date()

Rename these because time() and date() are probably defined somewhere
else too, and they're not very descriptive function names anyway.

12 years agoAdd the --quiet flag
Esko Kokkonen [Sun, 18 Sep 2011 19:42:06 +0000 (22:42 +0300)]
Add the --quiet flag

This option gives less verbose output

12 years agoPrint total emerge time when inquiring pretended times.
Esko Kokkonen [Sun, 18 Sep 2011 15:11:37 +0000 (18:11 +0300)]
Print total emerge time when inquiring pretended times.

For this to work, the print_pretended_times() needs to return the
average time.

12 years agoDrop time() and date() from the class
Esko Kokkonen [Sun, 18 Sep 2011 15:03:04 +0000 (18:03 +0300)]
Drop time() and date() from the class

These don't need to be inside the class as they don't contribute to
the class variables in any way.

12 years agoDon't return function if exception occurs
Esko Kokkonen [Sun, 18 Sep 2011 14:56:20 +0000 (17:56 +0300)]
Don't return function if exception occurs

So remove the return line from the finally block.

12 years agoCapitalize global variable name
Esko Kokkonen [Sun, 18 Sep 2011 14:49:57 +0000 (17:49 +0300)]
Capitalize global variable name

Easier to keep track of variables if this one is all in capitals since
it really is a global one.

12 years agoRefine code structure and add function descriptions
Esko Kokkonen [Sun, 18 Sep 2011 14:42:46 +0000 (17:42 +0300)]
Refine code structure and add function descriptions

A futile attempt at making the code more readable.

12 years agoAdd the "--no-color" flag
Esko Kokkonen [Sun, 18 Sep 2011 14:34:43 +0000 (17:34 +0300)]
Add the "--no-color" flag

12 years agoSet the default mode as "package"
Esko Kokkonen [Sun, 18 Sep 2011 14:32:23 +0000 (17:32 +0300)]
Set the default mode as "package"

This way we don't overwrite the mode setting if we want to use for
example current emerge mode.

12 years agoMerge branch 'testing'
Esko Kokkonen [Sun, 18 Sep 2011 14:28:37 +0000 (17:28 +0300)]
Merge branch 'testing'

Not really a merge since removed everything that was in 'master'
branch. Stuff might be broken too.

12 years agoImprove commandline argument handling
Esko Kokkonen [Wed, 14 Sep 2011 09:08:48 +0000 (12:08 +0300)]
Improve commandline argument handling

12 years agoRemove unused variables
Esko Kokkonen [Sat, 10 Sep 2011 11:14:40 +0000 (14:14 +0300)]
Remove unused variables

12 years agoRemove unused module imports
Esko Kokkonen [Sat, 10 Sep 2011 11:14:22 +0000 (14:14 +0300)]
Remove unused module imports

12 years agoMake lines shorter
Esko Kokkonen [Sat, 10 Sep 2011 11:12:35 +0000 (14:12 +0300)]
Make lines shorter

12 years agoQuit the current emerge block is no emerge is found
Esko Kokkonen [Sat, 10 Sep 2011 11:11:05 +0000 (14:11 +0300)]
Quit the current emerge block is no emerge is found

12 years agoFix possible error situations
Esko Kokkonen [Sat, 10 Sep 2011 11:10:41 +0000 (14:10 +0300)]
Fix possible error situations

12 years agoAdd current emerge time feature
Esko Kokkonen [Sat, 10 Sep 2011 10:48:44 +0000 (13:48 +0300)]
Add current emerge time feature

12 years agoSplit up average_total_time() and max_min_time()
Esko Kokkonen [Sat, 10 Sep 2011 10:10:25 +0000 (13:10 +0300)]
Split up average_total_time() and max_min_time()

12 years agoRewrite commandline argument handling
Esko Kokkonen [Wed, 7 Sep 2011 19:03:13 +0000 (22:03 +0300)]
Rewrite commandline argument handling

Giving no arguments now prints the help screen. The current emerge
mode can be accessed using the '-c' flag.

12 years agoRemove needless module import
Esko Kokkonen [Wed, 7 Sep 2011 13:35:23 +0000 (16:35 +0300)]
Remove needless module import

Subprocess module requirement was removed from the code a while ago.

12 years agoopen_log(): Don't allow finally block to swallow function return
Esko Kokkonen [Wed, 7 Sep 2011 13:33:11 +0000 (16:33 +0300)]
open_log(): Don't allow finally block to swallow function return

If we run into the exception here, we don't need to return from this
function but to exit the whole program anyway.

12 years agoFix indendation error
Esko Kokkonen [Wed, 7 Sep 2011 13:30:20 +0000 (16:30 +0300)]
Fix indendation error

12 years agoget_date: remove unused variables
Esko Kokkonen [Wed, 7 Sep 2011 13:29:53 +0000 (16:29 +0300)]
get_date: remove unused variables

12 years agoPrint the emerge number for that package
Esko Kokkonen [Sun, 4 Sep 2011 15:28:04 +0000 (18:28 +0300)]
Print the emerge number for that package

12 years agoAdd pretended packages
Esko Kokkonen [Thu, 1 Sep 2011 10:42:31 +0000 (13:42 +0300)]
Add pretended packages

12 years agoChange how we pass the package into the log parser
Esko Kokkonen [Thu, 1 Sep 2011 09:33:29 +0000 (12:33 +0300)]
Change how we pass the package into the log parser

Don't use a list but only pass the class object into the function.

12 years agoRemove list_all_packages function
Esko Kokkonen [Mon, 29 Aug 2011 15:10:32 +0000 (18:10 +0300)]
Remove list_all_packages function

This function is no longer used anywhere as both the current emerge
stuff and pretended emerges are handled differently.

12 years agoImprove current process handling
Esko Kokkonen [Mon, 29 Aug 2011 15:05:21 +0000 (18:05 +0300)]
Improve current process handling

Use the same method of getting the package name as in the pretended
function. Now the print_current_emerges function is simplified by not
having to go through the list of all the package names.

12 years agoSearch ps with "ebuild.sh" instaed of "ebuild"
Esko Kokkonen [Mon, 29 Aug 2011 15:04:25 +0000 (18:04 +0300)]
Search ps with "ebuild.sh" instaed of "ebuild"

"ebuild" can match processes that don't handle the current emerge and
thus wont contain the package name.

12 years agolist_pretended: Don't print total time if there is only one package
Esko Kokkonen [Mon, 29 Aug 2011 10:40:06 +0000 (13:40 +0300)]
list_pretended: Don't print total time if there is only one package

12 years agolist_pretended: Don't query the all_packages function at all
Esko Kokkonen [Mon, 29 Aug 2011 10:39:21 +0000 (13:39 +0300)]
list_pretended: Don't query the all_packages function at all

This is no longer needed thanks to the previous commit.

12 years agolist_pretended: Change how the package name is parsed from stdin
Esko Kokkonen [Mon, 29 Aug 2011 10:14:22 +0000 (13:14 +0300)]
list_pretended: Change how the package name is parsed from stdin

Implement a better way of getting the package name and version from
stdin. This doesn't involve going through a list of all packages in
such a tedious way it was before. Only thing this now requires is that
the version number of any package always starts with a digit. So a
version number like "-1.0" is totally fine, but a version number like
"-r1-1.0" is not. Hopefully the latter ones aren't that common.

12 years agoFirst implementation of the pretended packages feature
Esko Kokkonen [Mon, 29 Aug 2011 10:02:22 +0000 (13:02 +0300)]
First implementation of the pretended packages feature

12 years agominor fixing
Esko Kokkonen [Fri, 26 Aug 2011 15:40:33 +0000 (18:40 +0300)]
minor fixing

12 years agoAdd min, max, average time printouts
Esko Kokkonen [Fri, 26 Aug 2011 10:39:12 +0000 (13:39 +0300)]
Add min, max, average time printouts

12 years agoAdd get_package function
Esko Kokkonen [Fri, 26 Aug 2011 09:39:25 +0000 (12:39 +0300)]
Add get_package function

12 years agoFix but with packages with names with '-'s in them
Esko Kokkonen [Fri, 26 Aug 2011 09:30:53 +0000 (12:30 +0300)]
Fix but with packages with names with '-'s in them

So like packages name 'gcc-config'

12 years agoImprove class functionality
Esko Kokkonen [Thu, 25 Aug 2011 16:52:43 +0000 (19:52 +0300)]
Improve class functionality

12 years agoCleanup the main_loop code
Esko Kokkonen [Thu, 25 Aug 2011 16:22:41 +0000 (19:22 +0300)]
Cleanup the main_loop code

It's mostly the same stuff, only slightly in a different order to
attempt to optimize the emerge log scanning a bit.

12 years agomore rewriting
Esko Kokkonen [Thu, 25 Aug 2011 09:53:41 +0000 (12:53 +0300)]
more rewriting

basic functionality added. is now usable.

12 years agoRemove 'times' global variable
Esko Kokkonen [Wed, 24 Aug 2011 09:05:17 +0000 (12:05 +0300)]
Remove 'times' global variable

The local 'times' variable is still use in various functions.

12 years agorewriting
Esko Kokkonen [Wed, 24 Aug 2011 10:18:08 +0000 (13:18 +0300)]
rewriting

added first class structure

12 years agoDon't print anything if a package hasn't been emerged
Esko Kokkonen [Wed, 24 Aug 2011 09:03:44 +0000 (12:03 +0300)]
Don't print anything if a package hasn't been emerged

12 years agoUse \t to line up the times in the printout
Esko Kokkonen [Sun, 21 Aug 2011 14:23:03 +0000 (17:23 +0300)]
Use \t to line up the times in the printout

12 years agoRemove the time writing function
Esko Kokkonen [Sat, 20 Aug 2011 11:45:10 +0000 (14:45 +0300)]
Remove the time writing function

Don't write the emerge times into a file

12 years agoDon't print time to finish if there is no average time
Esko Kokkonen [Sat, 20 Aug 2011 11:36:40 +0000 (14:36 +0300)]
Don't print time to finish if there is no average time

Drop the whole finish time section out if there is no average
time. Also don't print negative finish times. Change the newline
commands a bit.

12 years agoGet absolute value for the time to finish
Esko Kokkonen [Sat, 20 Aug 2011 09:04:33 +0000 (12:04 +0300)]
Get absolute value for the time to finish

12 years agoMerge branch 'master' of itanic.dy.fi:/home/git/emerge-timer
Esko Kokkonen [Sat, 20 Aug 2011 08:56:07 +0000 (11:56 +0300)]
Merge branch 'master' of itanic.dy.fi:/home/git/emerge-timer

12 years agoPrin time to finish in current emerge times
Esko Kokkonen [Sat, 20 Aug 2011 08:48:04 +0000 (11:48 +0300)]
Prin time to finish in current emerge times

Have to also fiddle around with the newline printing since they're
scattered in different functions. This might need some revising to
make the output prettier.

12 years agoReset the times -list in the beginning of the main_loop function.
Esko Kokkonen [Sat, 20 Aug 2011 08:30:23 +0000 (11:30 +0300)]
Reset the times -list in the beginning of the main_loop function.

If this list is not emptied, it would have kept adding emerge times
into it, even if the times would belong to another package.

12 years agobegin rewrite
Esko Kokkonen [Fri, 19 Aug 2011 15:48:49 +0000 (18:48 +0300)]
begin rewrite

12 years agoDelete plotting.gpl
Esko Kokkonen [Fri, 19 Aug 2011 10:47:23 +0000 (13:47 +0300)]
Delete plotting.gpl

12 years agoMerge branch 'master' of /home/git/emerge-timer
Esko Kokkonen [Thu, 18 Aug 2011 15:26:46 +0000 (18:26 +0300)]
Merge branch 'master' of /home/git/emerge-timer

12 years agoRemove useless variable
Esko Kokkonen [Thu, 18 Aug 2011 14:49:19 +0000 (17:49 +0300)]
Remove useless variable

emerge_number is not needed because the length of the list 'times'
posesses the same information.

12 years agoRemove useless variable
Esko Kokkonen [Thu, 18 Aug 2011 14:49:19 +0000 (17:49 +0300)]
Remove useless variable

emerge_number is not needed because the length of the list 'times'
posesses the same information.

12 years agoUse correct spacing in printouts
Esko Kokkonen [Thu, 18 Aug 2011 14:29:31 +0000 (17:29 +0300)]
Use correct spacing in printouts

Easier to read a long list of packages when the spacing is the same on
each line.

12 years agoPrint how many packages there are in pretended emerge list
Esko Kokkonen [Thu, 18 Aug 2011 14:24:33 +0000 (17:24 +0300)]
Print how many packages there are in pretended emerge list

12 years agoAdd help screen
Esko Kokkonen [Thu, 18 Aug 2011 14:12:42 +0000 (17:12 +0300)]
Add help screen

The help screen can be accessed with the flags -h or --help

12 years agoIf only one emerge, return that emerge time
Esko Kokkonen [Wed, 17 Aug 2011 10:16:37 +0000 (13:16 +0300)]
If only one emerge, return that emerge time

Need to return even single emerge times so that they can be summed to
the total emerge time

12 years agoTake into account if there aren't any emerges for pretended package
Esko Kokkonen [Tue, 16 Aug 2011 17:52:33 +0000 (20:52 +0300)]
Take into account if there aren't any emerges for pretended package

Don't print the total time if there aren't any emerges for a pretended
package. Also if there is only one emerge.

12 years agolist_pretended: Print total time
Esko Kokkonen [Tue, 16 Aug 2011 17:29:46 +0000 (20:29 +0300)]
list_pretended: Print total time

Print the total emerge time of all the packages in the end

12 years agolist_pretended: Abort if there are no packages
Esko Kokkonen [Tue, 16 Aug 2011 16:59:34 +0000 (19:59 +0300)]
list_pretended: Abort if there are no packages

Exit the program if no usable packages are found

12 years agoAdd support for emerges pretended packages
Esko Kokkonen [Tue, 16 Aug 2011 16:35:49 +0000 (19:35 +0300)]
Add support for emerges pretended packages

By piping "emerge -p <packages>" to emerge-timer with the flag '-p'
you can now see their average emerge times.

12 years agoFix bug with packages with a special character in them
Esko Kokkonen [Tue, 16 Aug 2011 16:24:47 +0000 (19:24 +0300)]
Fix bug with packages with a special character in them

If a package had a '-' character in them, you weren't able to get a
current emerge time for it. This now fixes that using the list_all_packages()
function.

12 years agoCreate a function that list all packages in portage
Esko Kokkonen [Tue, 16 Aug 2011 15:51:03 +0000 (18:51 +0300)]
Create a function that list all packages in portage

12 years agoRename date_printer function to get_date
Esko Kokkonen [Sun, 14 Aug 2011 16:14:06 +0000 (19:14 +0300)]
Rename date_printer function to get_date

Rename this because the function doesn't actually print anything
anymore. It only converts the time its given in seconds to a date
string.

12 years agoMake a new function that has all the current emerge printing stuff
Esko Kokkonen [Sun, 14 Aug 2011 16:10:18 +0000 (19:10 +0300)]
Make a new function that has all the current emerge printing stuff

Keep the calculation stuff in the list_emerge_processes function but
make a new function with all the printing it used to do. Also the
packages list now is in the form [package, emerge-time]. Pass this
list to the printing function so it can print the emerge time aswell.

12 years agoRemove the maximum emerge time restriction
Esko Kokkonen [Sun, 14 Aug 2011 14:42:00 +0000 (17:42 +0300)]
Remove the maximum emerge time restriction

This is no longer needed when we see the current package from
the emerge process

12 years agoImprove code readability
Esko Kokkonen [Sat, 13 Aug 2011 16:12:50 +0000 (19:12 +0300)]
Improve code readability

Add spaces, comments, functions definitions and other improvements to
make the code more readable by human eyes.

12 years agoMove the current emerge check
Esko Kokkonen [Sat, 13 Aug 2011 16:07:47 +0000 (19:07 +0300)]
Move the current emerge check

Check if there are current emerges going on
earlier in the code and exit the function then.

12 years agoopen_log: Change how the error message is presented
Esko Kokkonen [Sat, 13 Aug 2011 15:58:09 +0000 (18:58 +0300)]
open_log: Change how the error message is presented

As it turns out, giving "permission denied" on IOError isn't actually
the way to go.

12 years agodate_printer: Remove useless variables from function parameter list
Esko Kokkonen [Sat, 13 Aug 2011 15:45:25 +0000 (18:45 +0300)]
date_printer: Remove useless variables from function parameter list

12 years agoPrint message if there is no current emerge process
Esko Kokkonen [Sat, 13 Aug 2011 15:42:40 +0000 (18:42 +0300)]
Print message if there is no current emerge process

12 years agoImprove if-block structure
Esko Kokkonen [Sat, 13 Aug 2011 15:30:22 +0000 (18:30 +0300)]
Improve if-block structure

By looking for the emerge startups earlier with if structures we can
simplify the process of searching the correct package in the log a
bit.

12 years agoImprove current emerge-time process
Esko Kokkonen [Sat, 13 Aug 2011 13:07:51 +0000 (16:07 +0300)]
Improve current emerge-time process

Instead of tediously scanning the emerge.log, look for the ebuild
process and get the package from there. Then look for the most recent
emerge startup time for that package and calculate the current emerge
time.

12 years agoFix bug with older emerge.log format handling
Esko Kokkonen [Sat, 13 Aug 2011 09:39:16 +0000 (12:39 +0300)]
Fix bug with older emerge.log format handling

Take into account if the string is shorter than it should be.