Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 15 Dec 2017, 04:36
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Building a universal file viewer
Post new topic   Reply to topic View previous topic :: View next topic
Page 10 of 12 [172 Posts]   Goto page: Previous 1, 2, 3, ..., 8, 9, 10, 11, 12 Next
Author Message
zigbert


Joined: 29 Mar 2006
Posts: 6524
Location: Valåmoen, Norway

PostPosted: Wed 21 Jun 2017, 04:30    Post subject:  

Very Happy Wonderful
_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
vovchik


Joined: 23 Oct 2006
Posts: 1442
Location: Ukraine

PostPosted: Wed 21 Jun 2017, 09:58    Post subject:  

And I agree with zigbert - works really well, looks great and does a lot. Thanks. Smile
Back to top
View user's profile Send private message 
step

Joined: 04 May 2012
Posts: 954

PostPosted: Wed 21 Jun 2017, 17:00    Post subject:  

Thank you for this new feature. The attached page is converted well, but there are some spurious '0' characters. Perhaps something odd with the version of sed?
Code:

Fatdog64-710# sed --version
sed (GNU sed) 4.2.2
2017-06-21.png
 Description   
 Filesize   6.23 KB
 Viewed   474 Time(s)

2017-06-21.png

not-found.html.gz
Description 
gz

 Download 
Filename  not-found.html.gz 
Filesize  877 Bytes 
Downloaded  30 Time(s) 

_________________
Fatdog64-710|+Packages|Kodi|Findnrun|+forum|gtkmenuplus
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1399
Location: Japan

PostPosted: Wed 21 Jun 2017, 21:43    Post subject:  

step wrote:
Perhaps something odd with the version of sed?
Unlikely. The sed job (adding blank line before "Page Not Found" and the following paragraph) worked well, but something must be wrong with your tr version. Mine is BusyBox v1.21.0.

Try
Code:
echo -n $'Hello\nWorld' | tr -s '\r\n' '\x01'

If this results in Hello0World then tr failed to translate the newline character into hex01.

The converted page should look like this:
not-found.html.png
 Description   
 Filesize   8.3 KB
 Viewed   463 Time(s)

not-found.html.png


Last edited by MochiMoppel on Wed 21 Jun 2017, 22:43; edited 1 time in total
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 11274
Location: Gatineau (Qc), Canada

PostPosted: Wed 21 Jun 2017, 21:50    Post subject:  

Thanks, MochiMoppei.
_________________
musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
Back to top
View user's profile Send private message 
step

Joined: 04 May 2012
Posts: 954

PostPosted: Thu 22 Jun 2017, 02:05    Post subject:  

You're correct
Code:

# echo -n $'Hello\nWorld' | tr -s '\r\n' '\x01'
Hello0World# tr --version
tr (GNU coreutils) 8.22
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jim Meyering.
# echo -n $'Hello\nWorld' | busybox tr -s '\r\n' '\x01'
HelloWorld#


_________________
Fatdog64-710|+Packages|Kodi|Findnrun|+forum|gtkmenuplus
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1399
Location: Japan

PostPosted: Thu 22 Jun 2017, 03:01    Post subject:  

Fatdog again? I'm getting increasingly frustrated. Slacko and Tahrpup use busybox.

It appears that coreutils tr does not understand '\x01'. Though '\01' (or just '\1') should work in both coreutils and busybox, it is not understood by sed.
Back to top
View user's profile Send private message 
step

Joined: 04 May 2012
Posts: 954

PostPosted: Thu 22 Jun 2017, 04:18    Post subject:  

I added "busybox" in front of "tr" and got clean output.
I share your frustration, though not about Fatdog but instead about the inconsistencies between busybox and GNU coreutils. I often end up replacing tr/sed/cut/grep pipelines with a single call to gawk, so I don't have to remember the syntax flavors of each utility.

_________________
Fatdog64-710|+Packages|Kodi|Findnrun|+forum|gtkmenuplus
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1646

PostPosted: Thu 22 Jun 2017, 06:12    Post subject:  

Code:
$'\x01'

^ works fine for me in FD with both BB's and CU's tr.

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
tallboy


Joined: 21 Sep 2010
Posts: 821
Location: Oslo, Norway

PostPosted: Fri 23 Jun 2017, 06:14    Post subject:  

I am remastering and playing around with Lucid 5.2.8.7, (yes, I actually consider upgrading to a newer puppy - from 5.2.8.005-1 Cool ). I have followed the development of MMview, so I decided to give it a go.
I am very impressed with MMview, but it need further development.

I have been a user of Lynx, the hierarchical terminal browser, for many years. I never use it as a browser, but as a file manager! Incredibly quick to navigate down through the layers using he right arrow key until reaching bottom. There you can see the file contents with less or other viewers, and link to editors and other programs for working with the file, from the keyboard. I had hoped for some of the same functionality in MMview, but it is of course not hierarchical. Sad
Some remarks:
I miss a better indication of which window having focus, Places or files. May I suggest a change in pattern or color when ones laves a location, perhaps?

I also find the use of both keys and mouse a bit distracting, I prefer keys only in a program like this one. It is a bit unfair to compare MMview to Lynx, but I really miss the hierarchy function, it's so easy to use.

Strange behaviour, intended or not?:
To get a feeling of the program, I unintentionally ended up in /root/Choises/MIME-types/ and scrolled down to application_vnd.ms-work, and used Ctrl-F5 to see the contents. The file is empty, but to my surprise Abiword opened, ready for writing, with no real address in the status line of the frame, just the word root, no slashes.

_________________
True freedom is a live Puppy on a multisession CD/DVD.
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1399
Location: Japan

PostPosted: Sat 24 Jun 2017, 02:28    Post subject:  

@tallboy: Thanks for playing around with MMview. I'm very impressed that you are impressed because MMview hardly works with Lucid 5.2.8.7. Most of the filetypes it is supposed to display are not recognized. Why? Lucid 5.2.8.7 uses an old version of the file command and there are probaly other factors that cause this version to often return only the mime-type of a file, but not the mime-encoding. And even the mime-type can be ambiguous. E.g. directories and symlinked scripts are reported as "application/x-not-regular-file". MMview can't work with such fuzzy information. Look at the statusbar of the screenshot in the initial post. I bet your statusbar looks different.

tallboy wrote:
I had hoped for some of the same functionality in MMview, but it is of course not hierarchical.
I don't understand what you mean by "hierarchical".

tallboy wrote:
I miss a better indication of which window having focus, Places or files.
That's your job: Choose a better GTK theme. Lucid by default uses Stardust, which indeed makes is hard to detect any difference between a focussed and not focussed selection. Lucid comes with GTK theme chooser and GTK theme maker. For me I changed selected text to bright red (see my screenshots) and have no difficulty to figure out if the Places pane or the file list has focus, but this is a global change and I have no business to interfere with a user's preferred GTK theme.

tallboy wrote:
I also find the use of both keys and mouse a bit distracting
Then don't use a mouse. You can operate MMview only with keys.

tallboy wrote:
Strange behaviour, intended or not?:
To get a feeling of the program, I unintentionally ended up in /root/Choises/MIME-types/ and scrolled down to application_vnd.ms-work, and used Ctrl-F5 to see the contents. The file is empty, but to my surprise Abiword opened
The strangeness is not intended, but the result is.
application_vnd.ms-work is a script and it is not empty. Ctrl-F5 does not let you "see the contents", it is supposed to run an executable. And since application_vnd.ms-work is supposed to open the defaultwordprocessor you will be greeted by Abiword when you apply Ctrl+F5. Hardly a surprise. The problem here is that you couldn't see the script contents in the viewer pane, which might have made you believe that the file is empty, but this is a result of the aforementioned problems with mime detection.
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 11274
Location: Gatineau (Qc), Canada

PostPosted: Sat 24 Jun 2017, 03:34    Post subject:  

@tallboy

If I may:
You could compile the newest file utility (v. 5.31) on Lucid, could you not?
Sources: http://www.darwinsys.com/file (developer's page)
ftp://ftp.astron.com/pub/file (code)
Version 5.31 is at the bottom of the ftp page listing.
It is very easy to compile this utility.

About the lack of contrast of a particular GTK2 theme, you could leave
your general GTK2 theme alone and use a second GTK2 theme that has
the contrast you want, expressly for Mochi's MMView. This "two GTK2
themes" approach is nicely explained by urukrama here:
https://urukrama.wordpress.com/2008/07/13/setting-a-custom-gtk-theme-for-specific-applications

My take on it is here. It's in French, and it's responding to a different
issue, but the examples may be helpful.

IHTH.

_________________
musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
Back to top
View user's profile Send private message 
some1

Joined: 17 Jan 2013
Posts: 75

PostPosted: Sat 24 Jun 2017, 09:58    Post subject:  

File is basically just a parser - with som default resolvements -
the more specific data are in the mime-database,the magic-files.

There are ways to update the mime-database -
and for USER to apply his/her own types.

As I recall - the puppy-wiki has a paragraph about adding mime-types.


MMview depends on the mime-types MochiMoppel covers,
probably those in Slacko/Tahr.
No objections to that.
----
Back to top
View user's profile Send private message 
tallboy


Joined: 21 Sep 2010
Posts: 821
Location: Oslo, Norway

PostPosted: Sat 24 Jun 2017, 14:26    Post subject:  

Thank you for the feedback, Moppi. When I played with MMview, it slowly dawned on me that Lucid wasn't the ideal platform for MMview. But even if I wasn't so impressed with my results with MMview, because of Lucid, I am very impressed by the way you work and your dedication to the project. I bow to you.

Re hierachical: Even if I know what it means, but I could not find the words for an explanation (I'm a foreigner, you know!), so I cheated: Very Happy Merriam-Webster dictionary present a definition of hierarchy as a graded or ranked series or a hierarchy of values.
A better explanation of Lynx is maybe that it see the directories and files as a tree. I once demonstrated it's use - with pictures - in this thread: http://www.murga-linux.com/puppy/viewtopic.php?p=839137#839137

tallboy
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 2001
Location: In The Way

PostPosted: Thu 29 Jun 2017, 18:22    Post subject:  

When previewing images/text/pdf etc what would it take to implement pinch to zoom in the preview window? For those of us with touch screens.
Back to top
View user's profile Send private message MSN Messenger 
Display posts from previous:   Sort by:   
Page 10 of 12 [172 Posts]   Goto page: Previous 1, 2, 3, ..., 8, 9, 10, 11, 12 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0661s ][ Queries: 14 (0.0102s) ][ GZIP on ]