Changes

Jump to navigation Jump to search
Line 55: Line 55:  
:A step by step absraction:
 
:A step by step absraction:
 
   
 
   
:'''1) ''' During boot of the xos, the shell will compile itself in compliance to supported file types, and have the print button enabled only when they are available.
+
:'''1) ''' During boot of the XO laptops, the shell will compile itself in compliance to supported file types, and have the print button enabled only when they are available.
    
:'''2)''' The print button on click saves the file to journal.This will have the same implementation as of a save file.
 
:'''2)''' The print button on click saves the file to journal.This will have the same implementation as of a save file.
Line 68: Line 68:  
:'''In-Depth analysis:'''
 
:'''In-Depth analysis:'''
   −
:The easiest way to implement step-1 would be to check which mime types exist on the server side in the etc/cups/mime.types file with a simple python method (getAllowableMIMETypes) and make it available :on the server's web folder, and access it with a c program during the xo's boot and append the list to our client side mime.types. So anything non-existent here will have its corresponding activities :print button disabled  
+
:The easiest way to implement step-1 would be to check which mime types exist on the server side in the etc/cups/mime.types file with a simple python method (getAllowableMIMETypes) and make it available :on the server's web folder, and access it with a c program during the XO laptops boot and append the list to our client side mime.types. So anything non-existent here will have its corresponding activities :print button disabled  
    
:As an Alternative, CUPS print function returns a python -1/ C 0 when a non-supported MIME type is used, so we can take advantage of that and display a non supported format error.
 
:As an Alternative, CUPS print function returns a python -1/ C 0 when a non-supported MIME type is used, so we can take advantage of that and display a non supported format error.
   −
:The xo already comes with a nice save feature which saves files to the journal and categorizes them under the activity name. I will use a similar implementation for the print button in activities (which :is activated from step-1) and have it save files under a 'To Print' category/tag in the journal.
+
:Sugar already comes with a nice save feature which saves files to the journal and categorizes them under the activity name. I will use a similar implementation for the print button in activities (which :is activated from step-1) and have it save files under a 'To Print' category/tag in the journal.
    
:for step-3, we use CUPS. The API has a nice array of functions, one of which is to get the printers name (we will be having the network printer, and especially the cups-pdf printer installed on the :server). Since we know the name is CUPS-PDF, we can check it, and print our file as a PDF on the server.
 
:for step-3, we use CUPS. The API has a nice array of functions, one of which is to get the printers name (we will be having the network printer, and especially the cups-pdf printer installed on the :server). Since we know the name is CUPS-PDF, we can check it, and print our file as a PDF on the server.
143

edits

Navigation menu