As it pertains to white (auto-shot) damage, weapon DPS is also increased by attack power at a rate of 1 DPS per 14 AP. For all other (yellow) attacks that have a "weapon damage" scaling component, that component scales similarly with AP, but only after normalizing your weapon to a 2.8 base shot speed for purposes of the calculation (this is to prevent 3.0-speed weapons from being inherently superior to those with a 2.8 or faster speed), resulting in 20% AP scaling for the "weapon damage" portion of the damage calculation.
So, as sisk already replied, the second (hypothetical?) weapon is vastly superior, all other factors remaining identical (and very likely regardless of all other factors). It has an auto-shot dps of 542.4 compared to weapon #1's auto-shot dps of 452.