Sponsored Content
Top Forums Shell Programming and Scripting Make python script ignore .htaccess Post 302319316 by medic on Monday 25th of May 2009 03:53:41 AM
Old 05-25-2009
Thanks for the fast reply.

As always you found the problem, it was:

Code:
                        if files.startswith("."):
                            #break <<<----------- you are breaking out of the second for loop. which is not what you want. You use "continue" here. 
                            continue

The break was my logical mistake, I was searching all the time.

With the following piece of code, I just opened the scanner files at the beginning and killed the old logs in it or even if the file got lost it is created.

Code:
datei=open(outfile,"w")
datei.close()
dateilog=open(logfile,"w")
dateilog.close()

Thanks for the hint with the next lines, I just started with python and added line by line not thinking of being able to combine them. Smilie

Code:
if os.path.isdir(os.path.join(root, allfiles)):    <<-------- if os.path.isdir(os.path.join(root, allfiles)) and "id" in allfiles
    if "id" in allfiles:

The next line I used because at one test I had an error, because I just copied a folder into public_html, that was a link to the mail folder. So added that code to check if the file is really a file and not a folder or link. Is there also a logical mistake?

Code:
if os.path.isfile(os.path.join(r,files)):

Thanks again for that fast help.
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how to make a current running process ignore SIGHUP signal?

I ask this question since sometimes i run a time-consuming ftp in foreground and forget to use nohup ftp.sh & to put this work background and can still running after i log off. Assume this ftp task have run 1 hour, and still 1 hour time to end, i don't want to abort the ftp, first, i use ctrl+Z... (3 Replies)
Discussion started by: stevensxiao
3 Replies

2. Shell Programming and Scripting

Make sed ignore lines

Hi I use sed in a script for severall changes in files. I whish one of the substitutions I made to be aplied to every line that has the word "scripts" with the exception for the ones that start with "rsh", wich I wish sed to ignore . Is this possible? If yes, how can I do it? The substitution... (2 Replies)
Discussion started by: Scarlos
2 Replies

3. UNIX for Dummies Questions & Answers

Howto locate locally installed Perl module for a CGI script in APACHE .htaccess

Hi, I have the following simple CGI script, just containg header: #!/usr/bin/perl -w use CGI ':standard'; use lib "/home/myname/lib/perl5/site_perl/5.8.5/"; use Mail::Sendmail; I also have included this directive in ~/public_html/.htaccess : SetEnv PERL5LIB... (0 Replies)
Discussion started by: monkfan
0 Replies

4. Shell Programming and Scripting

Ignore diriectories within a script

Hi there, I have a small issue with a script that I am running. I need it to ignore certain dir when copying over files. Ie the code is pointing towards the dir etest but I need to ignore the dirs INLINE and ENG which is contained within this...could anyone give me a pointer on how to do this? I... (9 Replies)
Discussion started by: lodey
9 Replies

5. UNIX for Dummies Questions & Answers

How to ignore errors in script

I have a simple script that processes files. Here's a simplified example of what I'm doing: foreach t (web.*) mv $t dnw$t:e.log end foreach t (card.*) mv $t card$t:e.log end The problem is that sometimes there is no web.* file. In that case, I get an error "foreach: No match" and... (4 Replies)
Discussion started by: software5723
4 Replies

6. Shell Programming and Scripting

Find all .htaccess files and make a backup copy in respective directories

Hey guys, I need to know how to locate all .htaccess files on the server and make a backup of them in the folder they reside before I run a script to modify all of them. So basically taking dir1/.htaccess and copying it as dir1/.htaccess_bk dir2/.htaccess copying as dir2/.htaccess_bk... (5 Replies)
Discussion started by: boxx
5 Replies

7. Shell Programming and Scripting

Ignore lines in Shell Script

Hi, I have a shell script, which reads a *.txt file - line by line. In this text file, I have some lines beginning with "#" that I want to ignore : MY_FILE #blah blah blah 1 blah blah blah 2 blah blah blah 3 #blah blah blah 4 I want my script to read only the following lines... (3 Replies)
Discussion started by: ad23
3 Replies

8. Windows & DOS: Issues & Discussions

How to execute python script on remote with python way..?

Hi all, I am trying to run below python code for connecting remote windows machine from unix to run an python file exist on that remote windows machine.. Below is the code I am trying: #!/usr/bin/env python import wmi c = wmi.WMI("xxxxx", user="xxxx", password="xxxxxxx")... (1 Reply)
Discussion started by: onenessboy
1 Replies

9. Shell Programming and Scripting

Python: make dual vector dot-product more pythonic

I have this dot product, calculating weighted means, and is applied to two columns in a list: # calculate weighted values in sequence for i in range(len(temperatures)-len(weights)): temperatures.append(sum(*temperatures for j in range(len(weights))])) temperatures.append(sum(*temperatures... (1 Reply)
Discussion started by: figaro
1 Replies
xcb_xkb_get_geometry(3) 					   XCB Requests 					   xcb_xkb_get_geometry(3)

NAME
xcb_xkb_get_geometry - SYNOPSIS
#include <xcb/xkb.h> Request function xcb_xkb_get_geometry_cookie_t xcb_xkb_get_geometry(xcb_connection_t *conn, xcb_xkb_device_spec_t deviceSpec, xcb_atom_t name); Reply datastructure typedef struct xcb_xkb_get_geometry_reply_t { uint8_t response_type; uint8_t deviceID; uint16_t sequence; uint32_t length; xcb_atom_t name; uint8_t found; uint8_t pad0; uint16_t widthMM; uint16_t heightMM; uint16_t nProperties; uint16_t nColors; uint16_t nShapes; uint16_t nSections; uint16_t nDoodads; uint16_t nKeyAliases; uint8_t baseColorNdx; uint8_t labelColorNdx; } xcb_xkb_get_geometry_reply_t; Reply function xcb_xkb_get_geometry_reply_t *xcb_xkb_get_geometry_reply(xcb_connection_t *conn, xcb_xkb_get_geometry_cookie_t cookie, xcb_generic_error_t **e); Reply accessors xcb_xkb_counted_string_16_t *xcb_xkb_get_geometry_label_font (const xcb_xkb_get_geometry_request_t *reply) int xcb_xkb_get_geometry_properties_length(const xcb_xkb_get_geometry_reply_t *reply); xcb_xkb_property_iterator_t xcb_xkb_get_geometry_properties_iterator(const xcb_xkb_get_geometry_reply_t *reply); int xcb_xkb_get_geometry_colors_length(const xcb_xkb_get_geometry_reply_t *reply); xcb_xkb_counted_string_16_iterator_t xcb_xkb_get_geometry_colors_iterator(const xcb_xkb_get_geometry_reply_t *reply); int xcb_xkb_get_geometry_shapes_length(const xcb_xkb_get_geometry_reply_t *reply); xcb_xkb_shape_iterator_t xcb_xkb_get_geometry_shapes_iterator(const xcb_xkb_get_geometry_reply_t *reply); int xcb_xkb_get_geometry_sections_length(const xcb_xkb_get_geometry_reply_t *reply); xcb_xkb_section_iterator_t xcb_xkb_get_geometry_sections_iterator(const xcb_xkb_get_geometry_reply_t *reply); int xcb_xkb_get_geometry_doodads_length(const xcb_xkb_get_geometry_reply_t *reply); xcb_xkb_doodad_iterator_t xcb_xkb_get_geometry_doodads_iterator(const xcb_xkb_get_geometry_reply_t *reply); xcb_xkb_key_alias_t *xcb_xkb_get_geometry_key_aliases(const xcb_xkb_get_geometry_request_t *reply); int xcb_xkb_get_geometry_key_aliases_length(const xcb_xkb_get_geometry_reply_t *reply); xcb_xkb_key_alias_iterator_t xcb_xkb_get_geometry_key_aliases_iterator(const xcb_xkb_get_geometry_reply_t *reply); REQUEST ARGUMENTS
conn The XCB connection to X11. deviceSpec TODO: NOT YET DOCUMENTED. name TODO: NOT YET DOCUMENTED. REPLY FIELDS
response_type The type of this reply, in this case XCB_XKB_GET_GEOMETRY. This field is also present in the xcb_generic_reply_t and can be used to tell replies apart from each other. sequence The sequence number of the last request processed by the X11 server. length The length of the reply, in words (a word is 4 bytes). deviceID TODO: NOT YET DOCUMENTED. name TODO: NOT YET DOCUMENTED. found TODO: NOT YET DOCUMENTED. widthMM TODO: NOT YET DOCUMENTED. heightMM TODO: NOT YET DOCUMENTED. nProperties TODO: NOT YET DOCUMENTED. nColors TODO: NOT YET DOCUMENTED. nShapes TODO: NOT YET DOCUMENTED. nSections TODO: NOT YET DOCUMENTED. nDoodads TODO: NOT YET DOCUMENTED. nKeyAliases TODO: NOT YET DOCUMENTED. baseColorNdx TODO: NOT YET DOCUMENTED. labelColorNdx TODO: NOT YET DOCUMENTED. DESCRIPTION
RETURN VALUE
Returns an xcb_xkb_get_geometry_cookie_t. Errors have to be handled when calling the reply function xcb_xkb_get_geometry_reply. If you want to handle errors in the event loop instead, use xcb_xkb_get_geometry_unchecked. See xcb-requests(3) for details. ERRORS
This request does never generate any errors. SEE ALSO
AUTHOR
Generated from xkb.xml. Contact xcb@lists.freedesktop.org for corrections and improvements. XCB
2014-06-10 xcb_xkb_get_geometry(3)
All times are GMT -4. The time now is 07:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy