leoyer / multi-mechanize

Automatically exported from code.google.com/p/multi-mechanize
0 stars 0 forks source link

Make multi-mechanize.py importable #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. From the python command line
2. import multi-mechanize

What is the expected output? What do you see instead?
import multi-mechanize
  File "<stdin>", line 1
    import multi-mechanize
                ^
SyntaxError: invalid syntax

What version of the product are you using? On what operating system?
trunk -r 406 on Ubuntu

Please provide any additional information below.
I have attached a patch file to make sure that it is importable moving the 
parsing of args to a function that is automatically called when the code is run 
on the commandline but can be called manually if imported. The patch must be 
applied and then the filename must be changed to not include a - which is 
causing the above error. 

Commands to run to apply patch:
cd <multimechanizefolder>
patch -p0 -i /<pathtofile>/makeImportable.diff
cp multi-mechanize.py multimechanize.py

Original issue reported on code.google.com by welshwon...@gmail.com on 27 Sep 2011 at 9:53

Attachments:

GoogleCodeExporter commented 9 years ago
Apologies: 
the above cp command should have been the following:
svn mv multi-mechanize.py multimechanize.py

Original comment by welshwon...@gmail.com on 27 Sep 2011 at 10:24

GoogleCodeExporter commented 9 years ago
In integrating this patch back into our code we noticed that to make it easier 
to import and run the code we can make the following changes to the global 
variables we introduced in the previous patch (see attached patch). 

Original comment by welshwon...@gmail.com on 27 Sep 2011 at 2:45

Attachments:

GoogleCodeExporter commented 9 years ago
We had an issue when we tried to import the code after we changed the module 
name from multi-mechanize to multimechanize.py this was because we accidentally 
chose the same name as the package multimechanise. Therefore the mv command 
above should be done slightly differently. e.g.
mv multi-mechanize.py mutlimechanizer.py 
(or whatever you want to call the module)

Original comment by welshwon...@gmail.com on 27 Sep 2011 at 2:49